[llvm-commits] CVS: llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp
Chris Lattner
sabre at nondot.org
Fri Apr 6 18:04:03 PDT 2007
Changes in directory llvm/lib/Transforms/IPO:
SimplifyLibCalls.cpp updated: 1.102 -> 1.103
---
Log message:
trunc to bool no longer compares against zero
---
Diffs of the changes: (+5 -10)
SimplifyLibCalls.cpp | 15 +++++----------
1 files changed, 5 insertions(+), 10 deletions(-)
Index: llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp
diff -u llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.102 llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.103
--- llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.102 Fri Apr 6 20:02:00 2007
+++ llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp Fri Apr 6 20:03:46 2007
@@ -847,16 +847,11 @@
static bool IsOnlyUsedInEqualsZeroComparison(Instruction *I) {
for (Value::use_iterator UI = I->use_begin(), E = I->use_end();
UI != E; ++UI) {
- Instruction *User = cast<Instruction>(*UI);
- if (ICmpInst *IC = dyn_cast<ICmpInst>(User)) {
- if ((IC->getPredicate() == ICmpInst::ICMP_NE ||
- IC->getPredicate() == ICmpInst::ICMP_EQ) &&
- isa<Constant>(IC->getOperand(1)) &&
- cast<Constant>(IC->getOperand(1))->isNullValue())
- continue;
- } else if (CastInst *CI = dyn_cast<CastInst>(User))
- if (CI->getType() == Type::Int1Ty)
- continue;
+ if (ICmpInst *IC = dyn_cast<ICmpInst>(*UI))
+ if (IC->isEquality())
+ if (Constant *C = dyn_cast<Constant>(IC->getOperand(1)))
+ if (C->isNullValue())
+ continue;
// Unknown instruction.
return false;
}
More information about the llvm-commits
mailing list