[PATCH] D111901: [VectorCombine] fold shuffle-of-binops with common operand

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 15 10:34:24 PDT 2021


spatel created this revision.
spatel added reviewers: fhahn, lebedev.ri, RKSimon.
Herald added subscribers: hiraditya, kristof.beyls, mcrosier.
spatel requested review of this revision.
Herald added a project: LLVM.

shuf (bo X, Y), (bo X, W) --> bo (shuf X), (shuf Y, W)

This is motivated by an example in D111800 <https://reviews.llvm.org/D111800> (although that patch would avoid the problem for that paritcular example).

The pattern is shown in reduced form with:
https://llvm.org/PR52178
https://alive2.llvm.org/ce/z/d8zB4D

There is no difference on the PhaseOrdering test from D111800 <https://reviews.llvm.org/D111800> because the aarch64 cost model says that the shuffle cost is 3 while the fadd cost is 2. That seems wrong for a simple v4f32 shuffle, but that should be another patch if correct.


https://reviews.llvm.org/D111901

Files:
  llvm/lib/Transforms/Vectorize/VectorCombine.cpp
  llvm/test/Transforms/VectorCombine/X86/shuffle.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111901.380028.patch
Type: text/x-patch
Size: 9726 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211015/46008b7e/attachment.bin>


More information about the llvm-commits mailing list