aqjune added inline comments.
================ Comment at: llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp:1728 // Vec. if (IdxN % DstNumElts != 0 || IdxN + DstNumElts > VecNumElts) { replaceInstUsesWith(CI, UndefValue::get(CI.getType())); ---------------- Guarded by this branch condition, the for loop at line 1740 never adds a mask that makes `Shuffle` point to the second operand vector (which was previously Undef, but now Poison). ================ Comment at: llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp:2613 - return InsertElementInst::Create(UndefValue::get(DestTy), Elem, - Constant::getNullValue(Type::getInt32Ty(CI.getContext()))); } ---------------- This creates `insertelement <1 x X86_mmx> undef, Elem, 0` Replacing undef with poison has no visible effect. ================ Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:1693 Value *NewRHS = ConstOp1 ? NewC : V1; - return createBinOpShuffle(NewLHS, NewRHS, Mask); + return createBinOpShuffle(NewLHS, NewRHS, Mask, false); } ---------------- Be conservative, and create shufflevector with undef if Mask may point to the second vector Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D94380/new/ https://reviews.llvm.org/D94380 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits