Skip to content

Commit 2f1e232

Browse files
committed
[InstCombine] Use m_Poison instead of m_Undef in some places (NFCI)
I believe that in these cases other conditions already ensure that the second operand is not used, this is mostly for clarity.
1 parent ecd269e commit 2f1e232

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2383,7 +2383,7 @@ static Instruction *foldTruncShuffle(ShuffleVectorInst &Shuf,
23832383
Type *DestType = Shuf.getType();
23842384
Value *X;
23852385
if (!match(Shuf.getOperand(0), m_BitCast(m_Value(X))) ||
2386-
!match(Shuf.getOperand(1), m_Undef()) || !DestType->isIntOrIntVectorTy())
2386+
!match(Shuf.getOperand(1), m_Poison()) || !DestType->isIntOrIntVectorTy())
23872387
return nullptr;
23882388

23892389
// The source type must have the same number of elements as the shuffle,
@@ -2755,17 +2755,17 @@ static Instruction *foldIdentityPaddedShuffles(ShuffleVectorInst &Shuf) {
27552755
// BinOp's operands are the result of a first element splat can be simplified to
27562756
// splatting the first element of the result of the BinOp
27572757
Instruction *InstCombinerImpl::simplifyBinOpSplats(ShuffleVectorInst &SVI) {
2758-
if (!match(SVI.getOperand(1), m_Undef()) ||
2758+
if (!match(SVI.getOperand(1), m_Poison()) ||
27592759
!match(SVI.getShuffleMask(), m_ZeroMask()) ||
27602760
!SVI.getOperand(0)->hasOneUse())
27612761
return nullptr;
27622762

27632763
Value *Op0 = SVI.getOperand(0);
27642764
Value *X, *Y;
2765-
if (!match(Op0, m_BinOp(m_Shuffle(m_Value(X), m_Undef(), m_ZeroMask()),
2765+
if (!match(Op0, m_BinOp(m_Shuffle(m_Value(X), m_Poison(), m_ZeroMask()),
27662766
m_Value(Y))) &&
27672767
!match(Op0, m_BinOp(m_Value(X),
2768-
m_Shuffle(m_Value(Y), m_Undef(), m_ZeroMask()))))
2768+
m_Shuffle(m_Value(Y), m_Poison(), m_ZeroMask()))))
27692769
return nullptr;
27702770
if (X->getType() != Y->getType())
27712771
return nullptr;

0 commit comments

Comments
 (0)