[llvm-dev] Any indispensable passes?

Peizhao Ou via llvm-dev llvm-dev at lists.llvm.org
Wed Mar 1 11:54:00 PST 2017


Hi everyone,

I am currently testing out a combination of IR->IR passes with opt to
benchmark how they affect performance. The source code works fine if simply
use the clang (-O0/-O3) to directly compile to object files and link them.
However, when I use opt with a select set of passes and then use llc to
compile them to binary, the compiled binary is wrong.

That makes me wonder if there are any IR->IR passes that are indispensable
and they are to guarantee the semantics?

Here's my workflow just in case:
*********************************************************************************
1. Compile the source code to unoptimized IRs:
clang -c -emit-llvm -O0 test.c -o test.bc
2. Run opt with a set of IR->IR passes, e.g.,
opt -simplifycfg -sroa -inferattrs -globalopt -instcombine -simplifycfg
-prune-eh -inline  -tailcallelim -simplifycfg -loop-simplify -lcssa
-loop-rotate -licm -gvn -verify test.bc -o test.bc
3. Run llc with -O0:
llc -file-type=obj test.bc -o test.o
4. Last link all the object files:
clang -O0 test1.o test2.o -o test
*********************************************************************************

Thanks,
Peizhao
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170301/b8abed08/attachment.html>


More information about the llvm-dev mailing list