[llvm-dev] Flags -O2 -O3

Mehdi AMINI via llvm-dev llvm-dev at lists.llvm.org
Tue Oct 1 00:21:31 PDT 2019

On Mon, Sep 30, 2019 at 9:48 AM David Fernandez Lobon via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hello LLVM Developers:
> I used  this command , *llvm-as < /dev/null | opt -O3 -disable-output
> -debug-pass=Arguments*,
> to take differents transformations of LLVM. I need to know if the order of
> this transformations how appear in the output of the command is the order
> to apply the differences flags to opt or what is the meaning?:
Not sure if I understand what you're asking, the output is a dump of the
pass pipeline, which is roughly what you need to give as command line
argument to opt to reproduce the execution.

> Pass Arguments:  -tti -tbaa -scoped-noalias -assumption-cache-tracker
> -targetlibinfo -verify -ee-instrument -simplifycfg -domtree -sroa
> -early-cse -lower-expect
> Pass Arguments:  -targetlibinfo -tti -tbaa -scoped-noalias
> -assumption-cache-tracker -profile-summary-info -forceattrs -inferattrs
> -domtree -callsite-splitting -ipsccp -called-value-propagation -globalopt
> -domtree -mem2reg -deadargelim -domtree -basicaa -aa -loops
> -lazy-branch-prob -lazy-block-freq -opt-remark-emitter -instcombine
> -simplifycfg -basiccg -globals-aa -prune-eh -inline -functionattrs
> -argpromotion -domtree -sroa -basicaa -aa -memoryssa -early-cse-memssa
> -speculative-execution -basicaa -aa -lazy-value-info -jump-threading
> -correlated-propagation -simplifycfg -domtree -aggressive-instcombine
> -basicaa -aa -loops -lazy-branch-prob -lazy-block-freq -opt-remark-emitter
> -instcombine -libcalls-shrinkwrap -loops -branch-prob -block-freq
> -lazy-branch-prob -lazy-block-freq -opt-remark-emitter -pgo-memop-opt
> -basicaa -aa -loops -lazy-branch-prob -lazy-block-freq -opt-remark-emitter
> -tailcallelim -simplifycfg -reassociate -domtree -loops -loop-simplify
> -lcssa-verification -lcssa -basicaa -aa -scalar-evolution -loop-rotate
> -licm -loop-unswitch -simplifycfg -domtree -basicaa -aa -loops
> -lazy-branch-prob -lazy-block-freq -opt-remark-emitter -instcombine
> -loop-simplify -lcssa-verification -lcssa -scalar-evolution -indvars
> -loop-idiom -loop-deletion -loop-unroll -mldst-motion -phi-values -basicaa
> -aa -memdep -lazy-branch-prob -lazy-block-freq -opt-remark-emitter -gvn
> -phi-values -basicaa -aa -memdep -memcpyopt -sccp -demanded-bits -bdce
> -basicaa -aa -loops -lazy-branch-prob -lazy-block-freq -opt-remark-emitter
> -instcombine -lazy-value-info -jump-threading -correlated-propagation
> -basicaa -aa -phi-values -memdep -dse -loops -loop-simplify
> -lcssa-verification -lcssa -basicaa -aa -scalar-evolution -licm
> -postdomtree -adce -simplifycfg -domtree -basicaa -aa -loops
> -lazy-branch-prob -lazy-block-freq -opt-remark-emitter -instcombine
> -barrier -elim-avail-extern -basiccg -rpo-functionattrs -globalopt
> -globaldce -basiccg -globals-aa -float2int -domtree -loops -loop-simplify
> -lcssa-verification -lcssa -basicaa -aa -scalar-evolution -loop-rotate
> -loop-accesses -lazy-branch-prob -lazy-block-freq -opt-remark-emitter
> -loop-distribute -branch-prob -block-freq -scalar-evolution -basicaa -aa
> -loop-accesses -demanded-bits -lazy-branch-prob -lazy-block-freq
> -opt-remark-emitter -loop-vectorize -loop-simplify -scalar-evolution -aa
> -loop-accesses -loop-load-elim -basicaa -aa -lazy-branch-prob
> -lazy-block-freq -opt-remark-emitter -instcombine -simplifycfg -domtree
> -loops -scalar-evolution -basicaa -aa -demanded-bits -lazy-branch-prob
> -lazy-block-freq -opt-remark-emitter -slp-vectorizer -opt-remark-emitter
> -instcombine -loop-simplify -lcssa-verification -lcssa -scalar-evolution
> -loop-unroll -lazy-branch-prob -lazy-block-freq -opt-remark-emitter
> -instcombine -loop-simplify -lcssa-verification -lcssa -scalar-evolution
> -licm -lazy-branch-prob -lazy-block-freq -opt-remark-emitter
> -transform-warning -alignment-from-assumptions -strip-dead-prototypes
> -globaldce -constmerge -domtree -loops -branch-prob -block-freq
> -loop-simplify -lcssa-verification -lcssa -basicaa -aa -scalar-evolution
> -branch-prob -block-freq -loop-sink -lazy-branch-prob -lazy-block-freq
> -opt-remark-emitter -instsimplify -div-rem-pairs -simplifycfg -verify
> Pass Arguments:  -domtree
> Pass Arguments:  -targetlibinfo -domtree -loops -branch-prob -block-freq
> Pass Arguments:  -targetlibinfo -domtree -loops -branch-prob -block-freq
> And also I would to know the meaning of the differences  appears of  Pass
> Arguments, it is a differences invokes of opt command ?

The `-O3`  shortcut is using the PassManagerBuilder which created multiple
pass pipelines and run them in sequences.
(I'm actually surprising about the last three though).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20191001/484e5c6e/attachment.html>

More information about the llvm-dev mailing list