<div dir="ltr">Hi, David<div>Thanks for your reply.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 22, 2015 at 12:37 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Apr 21, 2015 at 9:29 PM, Eric Lu <<a href="mailto:eirc.lew@gmail.com">eirc.lew@gmail.com</a>> wrote:<br>
><br>
> Best Regards!<br>
> Eric Lew<br>
><br>
> On 周三, 4月 22, 2015 at 12:11 下午, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>
><br>
> On Tue, Apr 21, 2015 at 8:34 PM, Eric Lu <<a href="mailto:eirc.lew@gmail.com">eirc.lew@gmail.com</a>> wrote:<br>
>> Hi, all<br>
>><br>
>> I want to instrument load/store operations in LLVM IR. And I find the LLVM<br>
>> IR generated with flag -o3 is much more efficient than -o0, so I try to<br>
>> instrument on these optimized LLVM IR, but, some load operations are<br>
>> changed<br>
>> to Phi loads. Then, I try the -reg2mem flag to remove these phi nodes.<br>
>> The problems are:<br>
>> 1) I use visitLoadInst to collect these load operations, and it seems I<br>
>> cannot reach these loads that are generated by reg2mem? What is the<br>
>> reason?<br>
><br>
> Clang doesn't generate optimized IR - so if your instrumentation is in<br>
> Clang's IRGen (clang/lib/CodeGen) it won't see these. Clang generates<br>
> the unoptimized IR (you can see it with -Xclang -disable-llvm-optzns)<br>
><br>
> I do instrumentation in the opt of llvm. Does clang itself do some<br>
> optimizations that speed up applications with -O3 compared to -O0?<br>
<br>
</span>A little bit, but not much.<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
><br>
>> 2) Is there any way to compile with -O3 but not generate phi nodes ?<br>
><br>
> Not likely - without that it'd disable a lot of LLVM's optimization power.<br>
><br>
> - David<br>
><br>
>><br>
>><br>
>> --<br>
>> Best Regards!<br>
>> Eric Lew<br>
>><br>
>> _______________________________________________<br>
>> LLVM Developers mailing list<br>
>> <a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
>><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Best Regards!<br>Eric Lew</div>
</div>