[LLVMdev] Address of label

Peltier, Mikael m-peltier at ti.com
Wed Jun 13 07:48:03 PDT 2007


 

Hello,

 

I search information in order to access address (i.e. value) of label directly in llvm assembler file.

This can be useful to realize jump table from address, etc.

 

I generate the file branch.ll from a C file.

In this file, we saw that branches are realized by affecting virtually an id to each label and use a switch in order to find the right target.

I want to know if there is another way to do this, for instance, by accessing the address of label and to branch directly to it? 

 

In order to optimize the program (to decrease the cost of branch dispatch), I use the following command line:

llvmc -O5 -o branch_opt branch.bc

llc -march=arm -mcpu=arm1136j-s -mattr=+v6 -f -o branch_opt.s branch_opt.bc

 

In the optimized program (branch_opt.arm),  I saw that all branches are not suppressed.

I want to know, if it is possible to suppress the remaining useless branches? if yes, how ?

 

Thanks in advance.

 

Mikaƫl.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20070613/0f912ee7/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: branch.ll
Type: application/octet-stream
Size: 2729 bytes
Desc: branch.ll
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20070613/0f912ee7/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: branch_opt.arm
Type: application/octet-stream
Size: 809 bytes
Desc: branch_opt.arm
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20070613/0f912ee7/attachment-0001.obj>


More information about the llvm-dev mailing list