[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Chris Lattner
sabre at nondot.org
Thu Jan 18 14:16:49 PST 2007
Changes in directory llvm/lib/Transforms/Scalar:
InstructionCombining.cpp updated: 1.602 -> 1.603
---
Log message:
Fix InstCombine/2007-01-18-VectorInfLoop.ll, a case where instcombine
infinitely loops.
---
Diffs of the changes: (+9 -3)
InstructionCombining.cpp | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.602 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.603
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.602 Thu Jan 18 12:54:33 2007
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Thu Jan 18 16:16:33 2007
@@ -3062,10 +3062,16 @@
// See if we can simplify any instructions used by the instruction whose sole
// purpose is to compute bits we don't care about.
uint64_t KnownZero, KnownOne;
- if (!isa<PackedType>(I.getType()) &&
- SimplifyDemandedBits(&I, I.getType()->getIntegerTypeMask(),
- KnownZero, KnownOne))
+ if (!isa<PackedType>(I.getType())) {
+ if (SimplifyDemandedBits(&I, I.getType()->getIntegerTypeMask(),
+ KnownZero, KnownOne))
return &I;
+ } else {
+ if (ConstantPacked *CP = dyn_cast<ConstantPacked>(Op1)) {
+ if (CP->isAllOnesValue())
+ return ReplaceInstUsesWith(I, I.getOperand(0));
+ }
+ }
if (ConstantInt *AndRHS = dyn_cast<ConstantInt>(Op1)) {
uint64_t AndRHSMask = AndRHS->getZExtValue();
More information about the llvm-commits
mailing list