[PATCH] D108136: [LoopVectorize] Permit vectorisation of more select(cmp(), X, Y) reduction patterns

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 5 01:04:20 PDT 2021


david-arm updated this revision to Diff 377109.
david-arm added a comment.

- Fixed a buildbot sanitiser issue that occurred after merging the patch. The issue was that the input to the `select` instruction came from the induction PHI, and the output fed into the reduction PHI. Therefore, there wasn't a complete circular dependency and we shouldn't have vectorised.
- I have added the original reduction PHI as a parameter to `isSelectCmpPattern` so that we can ensure the input matches the reduction PHI node. This is now defended by the negative test `select_i32_from_icmp_non_redux_phi`
- I also added a new test called `select_i32_from_icmp_same_inputs ` to ensure we don't vectorise when both the icmp and the select use the same PHI node.


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

https://reviews.llvm.org/D108136

Files:
  llvm/include/llvm/Analysis/IVDescriptors.h
  llvm/include/llvm/Transforms/Utils/LoopUtils.h
  llvm/lib/Analysis/IVDescriptors.cpp
  llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
  llvm/lib/Transforms/Utils/LoopUtils.cpp
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/lib/Transforms/Vectorize/VPlan.cpp
  llvm/test/Transforms/LoopVectorize/AArch64/sve-select-cmp.ll
  llvm/test/Transforms/LoopVectorize/scalable-reduction-inloop.ll
  llvm/test/Transforms/LoopVectorize/select-cmp-predicated.ll
  llvm/test/Transforms/LoopVectorize/select-cmp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108136.377109.patch
Type: text/x-patch
Size: 70747 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211005/9fe95f89/attachment.bin>


More information about the llvm-commits mailing list