Nitish Srivastava via llvm-dev
2017-Sep-05 15:16 UTC
[llvm-dev] Where to find the list of passes run by clang/opt with -O3
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, Best Regards, Nitish -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170905/e2827daf/attachment.html>
Davide Italiano via llvm-dev
2017-Sep-05 19:51 UTC
[llvm-dev] Where to find the list of passes run by clang/opt with -O3
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 lib/Transforms/IPO/PassManagerBuilder.cpp (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 :) -- Davide "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>
Davide Italiano via llvm-dev
2017-Sep-05 19:53 UTC
[llvm-dev] Where to find the list of passes run by clang/opt with -O3
On Tue, Sep 5, 2017 at 12:51 PM, Davide Italiano <davide at freebsd.org> wrote:> > > > 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. >>Also, the easiest hack to turn off LSR is that of probably just commenting out the line that adds the pass in PassManagerBuilder.cpp. If you use `opt` + the new pass manager there's a flag for testing to specify a custom pipeline, but that will be more work. -- Davide "There are no solved problems; there are only problems that are more or less solved" -- Henri Poincare