SimplifyCFG: Small cleanup, use ICmpInst::isEquality()

llvm-svn: 183151
This commit is contained in:
David Majnemer 2013-06-03 20:39:50 +00:00
parent edee182bef
commit 8e7dd2f628
1 changed files with 1 additions and 3 deletions

View File

@ -533,9 +533,7 @@ Value *SimplifyCFGOpt::isValueEqualityComparison(TerminatorInst *TI) {
} else if (BranchInst *BI = dyn_cast<BranchInst>(TI))
if (BI->isConditional() && BI->getCondition()->hasOneUse())
if (ICmpInst *ICI = dyn_cast<ICmpInst>(BI->getCondition()))
if ((ICI->getPredicate() == ICmpInst::ICMP_EQ ||
ICI->getPredicate() == ICmpInst::ICMP_NE) &&
GetConstantInt(ICI->getOperand(1), TD))
if (ICI->isEquality() && GetConstantInt(ICI->getOperand(1), TD))
CV = ICI->getOperand(0);
// Unwrap any lossless ptrtoint cast.