[PATCH] D75145: [PassManager] adjust VectorCombine placement

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 29 06:51:14 PST 2020


spatel updated this revision to Diff 247444.
spatel edited the summary of this revision.
spatel added a comment.

Patch updated:
After thinking this over (and stepping through the various existing vectorization enable/disable flags), I'm removing the loop-vectorizer predicate from this patch. The reasons are:

1. Although the flag is called is "-fno-vectorize" in clang, it only applies to loop-vectorization in LLVM, and the enable/disable logic is complicated. This is apparently necessary because we want vector pragmas on loops to override that flag.
2. -vector-combine is not something that we want to limit to -O2 (a silent side condition of the "LoopVectorize" predicate).
3. -vector-combine is not strictly about vectorizing code; the cleanup ability could extend to scalarizing in the future (ideally, we may offload some functionality that exists in or is proposed for InstCombine).

Part of the motivation for having a disable flag was addressed by adding a dedicated debug flag for -vector-combine with:
rG25c6544f32ee <https://reviews.llvm.org/rG25c6544f32eec4fd563f5531cec1d42b5c9c3e13>

So this patch is now simpler. If we do want to gate the cleanup passes in conjunction with other vectorization passes, we'll have better test coverage via:
rG99b86d76b5e1 <https://reviews.llvm.org/rG99b86d76b5e13e2257d791c66f45dd679b7bd92e>
(no diffs for now from this patch)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75145/new/

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.247444.patch
Type: text/x-patch
Size: 16717 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200229/9163fc8f/attachment.bin>


More information about the llvm-commits mailing list