Skip to content

[Transforms] Replace incorrect uses of m_Deferred with m_Specific #95719

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/lib/Analysis/InstructionSimplify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2016,7 +2016,7 @@ static Value *simplifyAndCommutative(Value *Op0, Value *Op1,
// (X | ~Y) & (X | Y) --> X
Value *X, *Y;
if (match(Op0, m_c_Or(m_Value(X), m_Not(m_Value(Y)))) &&
match(Op1, m_c_Or(m_Deferred(X), m_Deferred(Y))))
match(Op1, m_c_Or(m_Specific(X), m_Specific(Y))))
return X;

// If we have a multiplication overflow check that is being 'and'ed with a
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ static Value *foldAndOrOfICmpsWithConstEq(ICmpInst *Cmp0, ICmpInst *Cmp1,
// operand 0).
Value *Y;
ICmpInst::Predicate Pred1;
if (!match(Cmp1, m_c_ICmp(Pred1, m_Value(Y), m_Deferred(X))))
if (!match(Cmp1, m_c_ICmp(Pred1, m_Value(Y), m_Specific(X))))
return nullptr;

// Replace variable with constant value equivalence to remove a variable use:
Expand Down Expand Up @@ -1550,7 +1550,7 @@ Instruction *InstCombinerImpl::canonicalizeConditionalNegationViaMathToSelect(
if (!match(&I, m_c_BinOp(m_OneUse(m_Value()), m_Value())) ||
!match(I.getOperand(1), m_SExt(m_Value(Cond))) ||
!Cond->getType()->isIntOrIntVectorTy(1) ||
!match(I.getOperand(0), m_c_Add(m_SExt(m_Deferred(Cond)), m_Value(X))))
!match(I.getOperand(0), m_c_Add(m_SExt(m_Specific(Cond)), m_Value(X))))
return nullptr;
return SelectInst::Create(Cond, Builder.CreateNeg(X, X->getName() + ".neg"),
X);
Expand Down Expand Up @@ -3785,7 +3785,7 @@ Instruction *InstCombinerImpl::visitOr(BinaryOperator &I) {
const auto TryXorOpt = [&](Value *Lhs, Value *Rhs) -> Instruction * {
if (match(Lhs, m_c_Xor(m_And(m_Value(A), m_Value(B)), m_Deferred(A))) &&
match(Rhs,
m_c_Xor(m_And(m_Specific(A), m_Specific(B)), m_Deferred(B)))) {
m_c_Xor(m_And(m_Specific(A), m_Specific(B)), m_Specific(B)))) {
return BinaryOperator::CreateXor(A, B);
}
return nullptr;
Expand Down