[PATCH] D100639: [CodeGen] Improve code generation for clamping of constant indices with scalable vectors

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 16 04:02:05 PDT 2021


david-arm created this revision.
david-arm added reviewers: sdesmalen, kmclaughlin, c-rhodes, frasercrmck, efriedma.
Herald added subscribers: ecnelises, luismarques, apazos, sameer.abuasal, s.egerton, Jim, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya.
david-arm requested review of this revision.
Herald added subscribers: llvm-commits, MaskRay.
Herald added a project: LLVM.

When trying to clamp a constant index into a scalable vector we can
test if the index is less than the minimum number of elements in the
vector. If so, we can simply return the index because we know it is
guaranteed to fit inside the vector.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D100639

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
  llvm/test/CodeGen/AArch64/named-vector-shuffles-sve.ll
  llvm/test/CodeGen/AArch64/split-vector-insert.ll
  llvm/test/CodeGen/AArch64/sve-extract-vector.ll
  llvm/test/CodeGen/AArch64/sve-insert-vector.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-insert-subvector.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100639.338058.patch
Type: text/x-patch
Size: 30320 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210416/fa5848ee/attachment.bin>


More information about the llvm-commits mailing list