<DIV><FONT size=2>
<P>Hi ,</P>
<P>Regarding my previous help on LLVM Instrumentation , gdb helped me out.</P>
<P>Your docs on Writing an LLVM Pass - Using gdb with dynamically loaded </P>
<P>passes was very useful.</P>
<P>I've done some instrumentation and collected profiles during runtime using </P>
<P>library routines in a separate pass with opt tool.</P>
<P>I used :</P>
<P>In the tools/lli/Makefile , I included the following line </P>
<P>TOOLLINKOPTS := -lpthread</P>
<P>$opt -load ../../../mypass.so -myoption test.bc > test1.bc</P>
<P>$lli -load ../../../mypass.so test1.bc</P>
<P>using JIT and it worked perfectly.</P>
<P>Now I am trying to generate static native code generation and then execute the </P>
<P>native code program as:</P>
<P>$opt -load ../../../mypass.so -myoption test.bc > test1.bc</P>
<P>$llc -load ../../../mypass.so test1.bc -o test1.s</P>
<P>$gcc test1.s -o test1.native -lpthread</P>
<P>but now I get the following error</P>
<P>/tmp/cc8ilAEp.o(.text+0x251): In function `main':</P>
<P>: undefined reference to `llvm_profile_init'</P>
<P>/tmp/cc8ilAEp.o(.text+0x26d): In function `main':</P>
<P>: undefined reference to `llvm_method_entry'</P>
<P>/tmp/cc8ilAEp.o(.text+0x39e): In function `main':</P>
<P>: undefined reference to `llvm_method_exit'</P>
<P>/tmp/cc8ilAEp.o(.text+0x3a3): In function `main':</P>
<P>: undefined reference to `llvm_profile_display'</P>
<P>collect2: ld returned 1 exit status</P>
<P>$</P>
<P>I also tried with various gcc options like -shared , -shared-libgcc , -L</P>
<P>to link my library mypass.so ,but nothing worked.How can I do this?</P>
<P>I am also interested in knowing more about profile driven runtime optimizations </P>
<P>on LLVM1.5.Is it already available ? If so where can I find it? If not any hint</P>
<P>on how/where to start .</P>
<P>I found that optimizations of FunctionPass or MachineFunctionPass when used with </P>
<P>JIT are executed only once for each function. Am I wright ?</P>
<P>Is there any pass which will be executed each time a function is called or </P>
<P>whenever it is needed i.e. during runtime ? </P>
<P>Is it possible to inline/ clone the function after the machine code is generated ?</P>
<P> </P>
<P>Thanks in advance for any help,</P>
<P>Sandra</P>
<P> </P>
<P> </P></FONT></DIV><p>
                <hr size=1> <a href="http://us.lrd.yahoo.com/_ylc=X3oDMTFqODRtdXQ4BF9TAzMyOTc1MDIEX3MDOTY2ODgxNjkEcG9zAzEEc2VjA21haWwtZm9vdGVyBHNsawNmYw--/SIG=110oav78o/**http%3a//farechase.yahoo.com/">Yahoo! FareChase - Search multiple travel sites in one click.</a>