mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
Move "A | ~(A & ?) -> -1" from InstCombine to InstructionSimplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126082 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1161,6 +1161,16 @@ static Value *SimplifyOrInst(Value *Op0, Value *Op1, const TargetData *TD,
|
||||
(A == Op0 || B == Op0))
|
||||
return Op0;
|
||||
|
||||
// ~(A & ?) | A = -1
|
||||
if (match(Op0, m_Not(m_And(m_Value(A), m_Value(B)))) &&
|
||||
(A == Op1 || B == Op1))
|
||||
return Constant::getAllOnesValue(Op1->getType());
|
||||
|
||||
// A | ~(A & ?) = -1
|
||||
if (match(Op1, m_Not(m_And(m_Value(A), m_Value(B)))) &&
|
||||
(A == Op0 || B == Op0))
|
||||
return Constant::getAllOnesValue(Op0->getType());
|
||||
|
||||
// Try some generic simplifications for associative operations.
|
||||
if (Value *V = SimplifyAssociativeBinOp(Instruction::Or, Op0, Op1, TD, DT,
|
||||
MaxRecurse))
|
||||
|
||||
Reference in New Issue
Block a user