[PATCH] D86160: [VectorCombine] allow vector loads with mismatched insert type

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 1 04:25:06 PDT 2020


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

LGTM with one minor



================
Comment at: llvm/lib/Transforms/Vectorize/VectorCombine.cpp:150
+    SmallVector<int, 16> Mask(Ty->getNumElements());
+    std::iota(Mask.begin(), Mask.end(), 0);
+    VecLd = Builder.CreateShuffleVector(VecLd, UndefValue::get(VectorTy), Mask);
----------------
spatel wrote:
> RKSimon wrote:
> > Are we in danger of creating out of bounds shuffle mask indices if the dst vector type is more than 2x the original size (v2f32 -> v16f32 etc.) ? I think they canonicalize to undef but I'm not sure (+ have no access to the source tree atm)
> Nice catch - yes, that would crash on creation. Adjusted one of the tests to verify that.
(style) Don't call Ty->getNumElements in every loop

Maybe pull it out above the loop as we call it in the SmallVector constuctor as well?


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

https://reviews.llvm.org/D86160



More information about the llvm-commits mailing list