[llvm-dev] Any indispensable passes?

Peizhao Ou via llvm-dev llvm-dev at lists.llvm.org
Wed Mar 1 15:10:47 PST 2017


Hum, interesting. That would surprise me. I assumed them to do the same
thing, but I am not exactly sure. I just tried to clang instead of llc, it
seems like the problem remains.

Peizhao

On Wed, Mar 1, 2017 at 12:45 PM, Flamedoge <code.kchoi at gmail.com> wrote:

> 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/67d41b10/attachment.html>


More information about the llvm-dev mailing list