1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

simplify this code, duh.

llvm-svn: 95643
This commit is contained in:
Chris Lattner 2010-02-09 01:14:06 +00:00
parent 26b712379f
commit f6d9c1f90c

View File

@ -1147,19 +1147,15 @@ static Instruction *MatchSelectFromAndOr(Value *A, Value *B,
return 0;
// ((cond?-1:0)&C) | (B&(cond?0:-1)) -> cond ? C : B.
if (match(D, m_Not(m_SExt(m_Specific(Cond)))) &&
Cond->getType()->isInteger(1))
if (match(D, m_Not(m_SExt(m_Specific(Cond)))))
return SelectInst::Create(Cond, C, B);
if (match(D, m_SExt(m_Not(m_Specific(Cond)))) &&
Cond->getType()->isInteger(1))
if (match(D, m_SExt(m_Not(m_Specific(Cond)))))
return SelectInst::Create(Cond, C, B);
// ((cond?-1:0)&C) | ((cond?0:-1)&D) -> cond ? C : D.
if (match(B, m_Not(m_SExt(m_Specific(Cond)))) &&
Cond->getType()->isInteger(1))
if (match(B, m_Not(m_SExt(m_Specific(Cond)))))
return SelectInst::Create(Cond, C, D);
if (match(B, m_SExt(m_Not(m_Specific(Cond)))) &&
Cond->getType()->isInteger(1))
if (match(B, m_SExt(m_Not(m_Specific(Cond)))))
return SelectInst::Create(Cond, C, D);
return 0;
}