[PATCH] D80236: [VectorCombine] position pass after SLP in the optimization pipeline rather than before

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 19 13:44:40 PDT 2020


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

There are 2 known problem patterns shown in the test diffs here: vector horizontal ops (an x86 specialization) and vector reductions.
SLP has greater ability to match and fold those than vector-combine, so let SLP have first chance at that.
This is a quick fix while we continue to improve vector-combine and possibly canonicalize to reduction intrinsics.
In the longer term, we should improve matching of these patterns because if they were created in the "bad" forms shown here, then we would miss optimizing them.

I'm not sure what is happening with alias analysis on the addsub test. The old pass manager now shows an extra line for that, and we see an improvement that comes from SLP vectorizing a store. I don't know what's missing with the new pass manager to make that happen. Strangely, I can't reproduce the behavior if I compile from C++ with clang and invoke the new PM with "-fexperimental-new-pass-manager".


https://reviews.llvm.org/D80236

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/Other/opt-pipeline-vector-passes.ll
  llvm/test/Transforms/PhaseOrdering/X86/addsub.ll
  llvm/test/Transforms/PhaseOrdering/X86/horiz-math.ll
  llvm/test/Transforms/PhaseOrdering/X86/vector-reductions.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80236.265009.patch
Type: text/x-patch
Size: 20978 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200519/d254b7b8/attachment.bin>


More information about the llvm-commits mailing list