[llvm-dev] Where to find the list of passes run by clang/opt with -O3

Davide Italiano via llvm-dev llvm-dev at lists.llvm.org
Tue Sep 5 12:51:43 PDT 2017

On Tue, Sep 5, 2017 at 8:16 AM, Nitish Srivastava via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hi,
>   I am trying to locate the passes run by clang/opt when it is passed the
> option -O3. Can someone point me where to look at? Eventually, I want to
> turn off just the LoopStrengthReduction pass in the -O3 set of default
> passes.
>   Thanks,
Are you looking for code or just a textual dump?
In the former case, look at the functions in
(in llvm) [or lib/Passes if you're using the new pass manager
infrastructure]. The pipelines should be almost identical, FWIW.
If you want that from clang, you can either add `-mllvm
-debug-pass=Arguments` to get the passes passed to `opt`, or `-mllvm
-opt-bisect-limit=-1` which will show all the passes (and the order on
which they're run on each function in your Module).

Hope this answers your question (if it doesn't, feel free to ask again :)


"There are no solved problems; there are only problems that are more or
less solved" -- Henri Poincare
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170905/7f47ef45/attachment.html>

More information about the llvm-dev mailing list