[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Chris Lattner
lattner at cs.uiuc.edu
Wed Aug 13 00:40:01 PDT 2003
Changes in directory llvm/lib/Transforms/Scalar:
InstructionCombining.cpp updated: 1.114 -> 1.115
---
Log message:
Implement InstCombine/2003-08-12-AllocaNonNull.ll
---
Diffs of the changes:
Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.114 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.115
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.114 Wed Aug 13 00:33:12 2003
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Wed Aug 13 00:38:46 2003
@@ -768,9 +768,11 @@
if (Op0 == Op1)
return ReplaceInstUsesWith(I, ConstantBool::get(isTrueWhenEqual(I)));
- // setcc <global*>, 0 - Global value addresses are never null!
- if (isa<GlobalValue>(Op0) && isa<ConstantPointerNull>(Op1))
+ // setcc <global/alloca*>, 0 - Global/Stack value addresses are never null!
+ if (isa<ConstantPointerNull>(Op1) &&
+ (isa<GlobalValue>(Op0) || isa<AllocaInst>(Op0)))
return ReplaceInstUsesWith(I, ConstantBool::get(!isTrueWhenEqual(I)));
+
// setcc's with boolean values can always be turned into bitwise operations
if (Ty == Type::BoolTy) {
More information about the llvm-commits
mailing list