[LLVMdev] Different results using -emit-llvm and llc together than just using -S?

Ryan Taylor ryta1203 at gmail.com
Wed Mar 13 08:42:31 PDT 2013


Understood; however, I see the same change/difference when calling llc -O0?

Are there any other differences between calling these separately? Or does
llc not take -O levels?

On Wed, Mar 13, 2013 at 3:53 AM, Nick Lewycky <nicholas at mxc.ca> wrote:

> Ryan Taylor wrote:
>
>> Why would the generated assembly results for a piece of code be
>> different if I did this:
>>
>> clang -S -emit-llvm sample.c -o sample.ll
>> llc sample.ll -o sample.s
>>
>> then if I did this:
>>
>> clang -S sample.c -o sample.s
>>
>
> For one example, 'llc' defaults to -O2 but clang defaults to -O0. In
> general, clang sets up the equivalent of an opt|llc run with a slew of
> flags passed in. Also, note that clang -O0 is not the same as clang -O2
> -mllvm -disable-llvm-optzns, as clang chooses to emit more code which may
> prove useful to the optimizer, but would only waste time at -O0.
>
> Nick
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130313/2702bb53/attachment.html>


More information about the llvm-dev mailing list