[PATCH] D132308: [LV] Replace fixed-order cost model with a SK_Splice shuffle

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 20 11:38:48 PDT 2022


dmgreen created this revision.
dmgreen added reviewers: fhahn, RKSimon, PowerPC, Ayal, spatel, craig.topper, jonpa.
Herald added subscribers: StephenFan, hiraditya.
Herald added a project: All.
dmgreen requested review of this revision.
Herald added a subscriber: alextsao1999.
Herald added a project: LLVM.

The existing cost model for fixed-order recurrences models the phi as an extract shuffle of a v1 vector. The shuffle produced should be a splice, taking two vectors are extracting a subset of the lanes. On certain architectures the existing cost model can drastically under-estimate the correct cost for the shuffle, so this changes it to a SK_Splice, and passes a correct Mask through to the getShuffleCost call.

I believe this might be the first use of a SK_Splice shuffle cost model outside of scalable vectors, and some targets may require additions to the cost-model to correctly account for them.
https://godbolt.org/z/r8j69Kz9z


https://reviews.llvm.org/D132308

Files:
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/test/Transforms/LoopVectorize/ARM/mve-recurrence.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132308.454240.patch
Type: text/x-patch
Size: 13345 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220820/42219f89/attachment.bin>


More information about the llvm-commits mailing list