Skip to content

Commit

Permalink
[InstCombine] Remove redundant logical select fold (NFCI)
Browse files Browse the repository at this point in the history
This has been subsumed by simplifyWithOpReplaced().
  • Loading branch information
nikic committed Oct 24, 2023
1 parent 34c33bb commit 1a7061c
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3055,14 +3055,6 @@ Instruction *InstCombinerImpl::foldSelectOfBools(SelectInst &SI) {
if (match(CondVal, m_Select(m_Value(A), m_Value(B), m_Zero())) &&
match(TrueVal, m_Specific(B)) && match(FalseVal, m_Zero()))
return replaceOperand(SI, 0, A);
// select a, (select ~a, true, b), false -> select a, b, false
if (match(TrueVal, m_c_LogicalOr(m_Not(m_Specific(CondVal)), m_Value(B))) &&
match(FalseVal, m_Zero()))
return replaceOperand(SI, 1, B);
// select a, true, (select ~a, b, false) -> select a, true, b
if (match(FalseVal, m_c_LogicalAnd(m_Not(m_Specific(CondVal)), m_Value(B))) &&
match(TrueVal, m_One()))
return replaceOperand(SI, 2, B);

// ~(A & B) & (A | B) --> A ^ B
if (match(&SI, m_c_LogicalAnd(m_Not(m_LogicalAnd(m_Value(A), m_Value(B))),
Expand Down

0 comments on commit 1a7061c

Please sign in to comment.