[PATCH] D138873: [InstCombine] canonicalize trunc + insert as bitcast + shuffle, part 2

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 1 06:27:46 PST 2022


RKSimon accepted this revision.
RKSimon added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp:1554
+    // Check the shift amount to see if this can be folded to a select-shuffle.
+    // Big endian has MSB at vector index 0, so the insert index is flipped.
+    if (IsBigEndian && (NumEltsInScalar - 1 - IndexC) * VecEltWidth != ShiftC)
----------------
Make it clear that we only allow an 'identity' shuffle mask here


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

https://reviews.llvm.org/D138873



More information about the llvm-commits mailing list