Zhang Qiuyu
2004-Sep-22 00:28 UTC
[LLVMdev] The story is for why I need grab the entry address of BB :)
I mentioned a way which I used to grab the entry address of BB in previous email for Andrew. As I said, there is a limitation. And I am not sure it can be used for other cases. For my research code compression, my final goal is to improve the performance and keep code size as small as possible. Now, for the first step I want to code a program which can load and run elf binary code. Here, I want to load binary code by BBs. Initially the program will load the first BB in binary code ( entrance BB) and excute the instructions in BB. Once the program hit the instruct which need jump or enter another BB, it will load the mapped BB from binary code. And keep doing it. I will create a table which record the entry address for each BB. Once the BB has been loaded by pervious instruction, I don't need load it again. That is why I want to grab the entry address of each BB. Actually, I tried to use API ptrace to implement the program I mentioned. It means I can set breakpionts at each entry of BB, once the program hits the break point, I can use ptrace to load the next BB to memory. However, I haven't done it by using ptrace. The reason is that I don't know how complex process ptrace did. So I really want to write some assemble code or C to do it if I can. If I can finish the first step, I will find some optimization method based on BB to improve the performance. And then .... Is it clear for my project? :-) Thanks again. Qiuyu> On Mon, 20 Sep 2004, Zhang Qiuyu wrote: > > > I could get the address information by the way you guys mentioned. But > > it is not what I want, because it will lose information about the entry > > of basic block. Actually what I want to get is the address of each entry > > of basic block. Now I am trying to declare the label of basic block as > > global type, hopefully I can get it from symbol table. Can I get it by > > this way? > > I'm sure you could hack something, by emitting a global symbol like we do > for functions, but really, what are you trying to do? There is probably a > much better and more robust way to do it. If you tell us what you're > trying to actually accomplish (what you need the addresses of BB's for), > maybe we can make a useful suggestion. > > -Chris > > ---------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20040921/e15b5816/attachment.html>
Apparently Analagous Threads
- [LLVMdev] How could I get memory address for each basic block?
- [LLVMdev] How could I get memory address for each basic block?
- [LLVMdev] How could I get memory address for each basic block?
- [LLVMdev] How could I get memory address for each basic block?
- [LLVMdev] question about compile path