[PATCH] D26083: [LV] Scalarize operands of predicated instructions

Matthew Simpson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 30 09:00:43 PST 2016


mssimpso updated this revision to Diff 79755.
mssimpso marked 9 inline comments as done.
mssimpso added a comment.

Addressed comments from Michael and Gil.

I think I've taken care of everything mentioned until now. Thanks again for the reviews! With my testing concerns addressed, I think we're fine with the code generation tests remaining target-independent.

- Added a helper function in InnerLoopVectorizer combining Legal->isScalarAfterVectorization with Cost->isProfitableToScalarize. I replaced all uses of isScalarAfterVectorization in the vectorizer with the new helper function. I added a FIXME for the use of isScalarAfterVectorization in collectValuesToIgnore, like Michael suggested.
- Added an assert for Michael's non-scalar type question. Non-scalar types aren't allowable (we already check for this in canVectorizeInstrs), but I don't think an additional assert will hurt.
- Added a test requested by Michael for user-specified vectorization factors with no interleaving (AArch64/aarch64-predication.ll). The test is target-specific to ensure we perform the same optimization with and without manually specifying the vectorization factor.
- Reorganized scalarization conditions in canBeScalarized, and added a check for operands that are uniform-after-vectorization. This fixes the crash Gil discovered (X86/x86-predication.ll). The test is target-specific because the crash depends on the generation of masked loads.
- Added a check in canBeScalarized for the multi-context case. We now only consider instructions forming a single-use chain from the original predicated block that would otherwise be vectorized. I added a test case for the multi-context costs (AArch64/predication_costs.ll).
- Updated comments.


https://reviews.llvm.org/D26083

Files:
  lib/Transforms/Vectorize/LoopVectorize.cpp
  test/Transforms/LoopVectorize/AArch64/aarch64-predication.ll
  test/Transforms/LoopVectorize/AArch64/predication_costs.ll
  test/Transforms/LoopVectorize/X86/x86-predication.ll
  test/Transforms/LoopVectorize/if-pred-non-void.ll
  test/Transforms/LoopVectorize/if-pred-stores.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26083.79755.patch
Type: text/x-patch
Size: 26646 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161130/a21eacc4/attachment.bin>


More information about the llvm-commits mailing list