[cfe-dev] Use clang to generate LLVM IR with -O3, how to visit these load operations after -reg2mem

Eric Lu eirc.lew at gmail.com
Tue Apr 21 20:34:07 PDT 2015


Hi, all

I want to instrument load/store operations in LLVM IR. And I find the LLVM
IR generated with flag -o3 is much more efficient than -o0, so I try to
instrument on these optimized LLVM IR, but, some load operations are
changed to Phi loads. Then, I try the -reg2mem flag to remove these phi
nodes.
The  problems are:
1) I use visitLoadInst to collect these load operations, and it seems I
cannot reach these loads that are generated by reg2mem? What is the reason?
2) Is there any way to compile with -O3 but not generate phi nodes ?


-- 
Best Regards!
Eric Lew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150422/b5c8e2d1/attachment.html>


More information about the cfe-dev mailing list