[llvm] r183151 - SimplifyCFG: Small cleanup, use ICmpInst::isEquality()
David Majnemer
david.majnemer at gmail.com
Mon Jun 3 13:39:50 PDT 2013
Author: majnemer
Date: Mon Jun 3 15:39:50 2013
New Revision: 183151
URL: http://llvm.org/viewvc/llvm-project?rev=183151&view=rev
Log:
SimplifyCFG: Small cleanup, use ICmpInst::isEquality()
Modified:
llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
Modified: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp?rev=183151&r1=183150&r2=183151&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp Mon Jun 3 15:39:50 2013
@@ -533,9 +533,7 @@ Value *SimplifyCFGOpt::isValueEqualityCo
} 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.
More information about the llvm-commits
mailing list