[llvm-dev] Any indispensable passes?

Flamedoge via llvm-dev llvm-dev at lists.llvm.org
Wed Mar 1 12:45:34 PST 2017


>From my experience, I could not get llc to generate working object file. I
just used clang on llvm IR to do that.

Regards,
Kevin

On Wed, Mar 1, 2017 at 11:54 AM, Peizhao Ou via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> 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
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170301/30be4422/attachment.html>


More information about the llvm-dev mailing list