[llvm] [VectorCombine] vectorizeLoadInsert - fix shuffle when inserting into non-poison undef value (PR #119906)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 13 09:39:39 PST 2024


================
@@ -286,7 +290,7 @@ bool VectorCombine::vectorizeLoadInsert(Instruction &I) {
   Value *CastedPtr =
       Builder.CreatePointerBitCastOrAddrSpaceCast(SrcPtr, Builder.getPtrTy(AS));
   Value *VecLd = Builder.CreateAlignedLoad(MinVecTy, CastedPtr, Alignment);
-  VecLd = Builder.CreateShuffleVector(VecLd, Mask);
+  VecLd = Builder.CreateShuffleVector(VecLd, PoisonValue::get(MinVecTy), Mask);
----------------
RKSimon wrote:

I'm trying to avoid creating shuffles that specify just one source vector but use a mask that reference both.

https://github.com/llvm/llvm-project/pull/119906


More information about the llvm-commits mailing list