mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 20:29:48 +00:00
Extend the undef ^ undef idiom once more. No testcase: I can't figure out how to actually trigger the codepath in question at the moment, but it might get exposed in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137781 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
194bd89829
commit
207634263c
@ -1348,6 +1348,11 @@ static Value *SimplifyXorInst(Value *Op0, Value *Op1, const TargetData *TD,
|
||||
std::swap(Op0, Op1);
|
||||
}
|
||||
|
||||
// A ^ A = 0
|
||||
// Do this first so that we catch the undef ^ undef "idiom".
|
||||
if (Op0 == Op1)
|
||||
return Constant::getNullValue(Op0->getType());
|
||||
|
||||
// A ^ undef -> undef
|
||||
if (match(Op1, m_Undef()))
|
||||
return Op1;
|
||||
@ -1356,10 +1361,6 @@ static Value *SimplifyXorInst(Value *Op0, Value *Op1, const TargetData *TD,
|
||||
if (match(Op1, m_Zero()))
|
||||
return Op0;
|
||||
|
||||
// A ^ A = 0
|
||||
if (Op0 == Op1)
|
||||
return Constant::getNullValue(Op0->getType());
|
||||
|
||||
// A ^ ~A = ~A ^ A = -1
|
||||
if (match(Op0, m_Not(m_Specific(Op1))) ||
|
||||
match(Op1, m_Not(m_Specific(Op0))))
|
||||
|
Loading…
Reference in New Issue
Block a user