Skip to content

Commit 9312aa7

Browse files
committed
!fixup require second op poison
1 parent 0f3f2c1 commit 9312aa7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2599,9 +2599,10 @@ static Instruction *foldCastShuffle(ShuffleVectorInst &Shuf,
25992599
ShufOpTy->getElementCount().getKnownMinValue())
26002600
return nullptr;
26012601

2602-
// shuffle (cast X), Y, identity-with-extract-mask -->
2603-
// cast (shuffle X, Y, identity-with-extract-mask).
2604-
if (Cast0->hasOneUse() && Shuf.isIdentityWithExtract()) {
2602+
// shuffle (cast X), Poison, identity-with-extract-mask -->
2603+
// cast (shuffle X, Poison, identity-with-extract-mask).
2604+
if (Cast0->hasOneUse() && Shuf.isIdentityWithExtract() &&
2605+
isa<PoisonValue>(Shuf.getOperand(1))) {
26052606
auto *NewIns = Builder.CreateShuffleVector(Cast0->getOperand(0),
26062607
PoisonValue::get(CastSrcTy),
26072608
Shuf.getShuffleMask());

0 commit comments

Comments
 (0)