[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Chris Lattner
lattner at cs.uiuc.edu
Fri Sep 15 20:14:24 PDT 2006
Changes in directory llvm/lib/Transforms/Scalar:
InstructionCombining.cpp updated: 1.504 -> 1.505
---
Log message:
Fix Transforms/InstCombine/2006-09-15-CastToBool.ll and PR913: http://llvm.org/PR913
---
Diffs of the changes: (+5 -0)
InstructionCombining.cpp | 5 +++++
1 files changed, 5 insertions(+)
Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.504 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.505
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.504 Mon Sep 11 16:43:16 2006
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Fri Sep 15 22:14:10 2006
@@ -1011,6 +1011,11 @@
// If this is an integer truncate or noop, just look in the input.
if (SrcTy->getPrimitiveSizeInBits() >=
I->getType()->getPrimitiveSizeInBits()) {
+ // Cast to bool is a comparison against 0, which demands all bits. We
+ // can't propagate anything useful up.
+ if (I->getType() == Type::BoolTy)
+ break;
+
if (SimplifyDemandedBits(I->getOperand(0), DemandedMask,
KnownZero, KnownOne, Depth+1))
return true;
More information about the llvm-commits
mailing list