[llvm-dev] opt passes

Hal Finkel via llvm-dev llvm-dev at lists.llvm.org
Wed Jul 5 08:06:23 PDT 2017


On 07/05/2017 09:58 AM, Anastasiya Ruzhanskaya wrote:
> Oh, yes...strange
> |attributes #0 = { noinline nounwind optnone uwtable 
> "correctly-rounded-divide-sqrt-fp-math"="false" 
> "disable-tail-calls"="false" "less-precise-fpmad"="false" 
> "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" 
> "no-infs-fp-math"="false" "no-jump-tables"="false" 
> "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" 
> "no-trapping-math"="false" "stack-protector-buffer-size"="8" 
> "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" 
> "unsafe-fp-math"="false" "use-soft-float"="false" }
>
> |
> |How this can be avoided? it is always so after clang -s -emit-llvm
> |

This is because clang defaults to -O0, and in that mode, does not 
produce IR that is intended to be optimized. You probably want to do:

clang -S -emit-llvm -O3 -mllvm -disable-llvm-optzns

to get out the unoptimized IR.

  -Hal

>
>
>
> 2017-07-05 16:49 GMT+02:00 Hal Finkel <hfinkel at anl.gov 
> <mailto:hfinkel at anl.gov>>:
>
>
>     On 07/04/2017 04:25 AM, Anastasiya Ruzhanskaya via llvm-dev wrote:
>>     Hello,
>>      I am developing now a compiler, based on llvm infrastructure, so
>>     I am building my own sequence of llvm passes with some adjustable
>>     options.
>>
>>     I can't find really clear info about some cases, so maybe you can
>>     help, and write:
>>
>>     0) Why I should always delete attributes before applying
>>     optimizations with opt command? With attributes specified no
>>     optimization can be applied.
>
>     You definitely shouldn't delete attributes in general. Does your
>     attribute set include optnone?
>
>      -Hal
>
>>
>>     Where I can get real benefit from:
>>     1) Constant Hoisting
>>     -only when we have some large reusable constants in program?
>>     2) argpomotion
>>     - this option does not always replace all my args by reerence
>>     with values, when I specify it.
>>
>>
>>     _______________________________________________
>>     LLVM Developers mailing list
>>     llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>
>>     http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>>     <http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev>
>
>     -- 
>     Hal Finkel
>     Lead, Compiler Technology and Programming Languages
>     Leadership Computing Facility
>     Argonne National Laboratory
>
-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170705/8ac37e52/attachment.html>


More information about the llvm-dev mailing list