[PATCH] D75145: [PassManager] adjust VectorCombine placement

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 25 14:59:12 PST 2020


spatel created this revision.
spatel added reviewers: lebedev.ri, efriedma, RKSimon.
Herald added subscribers: dexonsmith, steven_wu, hiraditya, mcrosier.
Herald added a project: LLVM.

The initial placement of vector-combine in the opt pipeline revealed phase ordering bugs:
https://bugs.llvm.org/show_bug.cgi?id=45015
https://bugs.llvm.org/show_bug.cgi?id=42022

This patch proposes a few changes:

1. Gate running -vector-combine with -f[no-]vectorize; that is translated to "LoopVectorize/LoopVectorization" in the pass manager code. We shouldn't create vector ops if the user specified -fno-vectorize.
2. Move the pass up in the pipeline, so it happens just after loop-vectorization. This is only to keep vectorization passes together in the pipeline at the moment. I don't have any evidence of interaction between these yet.
3. Add an -early-cse pass after -vector-combine to clean up redundant ops. This was partly proposed as far back as rL219644 <https://reviews.llvm.org/rL219644> (which is why it's effectively being moved in the old PM code). This is important because the subsequent -instcombine doesn't work as well without this. With the CSE, -instcombine is able to squash shuffles together in 1 of the tests (because those are simple "select" shuffles).
4. Remove the -vector-combine pass that was running after SLP. We may want to do that eventually, but I don't have a test case to support it yet.


https://reviews.llvm.org/D75145

Files:
  llvm/lib/Passes/PassBuilder.cpp
  llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
  llvm/test/Other/new-pm-defaults.ll
  llvm/test/Other/new-pm-thinlto-defaults.ll
  llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll
  llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll
  llvm/test/Other/opt-O2-pipeline.ll
  llvm/test/Other/opt-O3-pipeline.ll
  llvm/test/Other/opt-Os-pipeline.ll
  llvm/test/Transforms/PhaseOrdering/X86/addsub.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75145.246578.patch
Type: text/x-patch
Size: 17190 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200225/a07592ed/attachment.bin>


More information about the llvm-commits mailing list