[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp

Chris Lattner sabre at nondot.org
Mon Sep 18 11:27:19 PDT 2006



Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.508 -> 1.509
---
Log message:

Fix an infinite loop building the CFE


---
Diffs of the changes:  (+2 -1)

 InstructionCombining.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.508 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.509
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.508	Mon Sep 18 00:27:43 2006
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp	Mon Sep 18 13:27:05 2006
@@ -3988,7 +3988,8 @@
           // preferable because it allows the C<<Y expression to be hoisted out
           // of a loop if Y is invariant and X is not.
           if (Shift && Shift->hasOneUse() && CI->isNullValue() &&
-              I.isEquality() && !Shift->isArithmeticShift()) {
+              I.isEquality() && !Shift->isArithmeticShift() &&
+              isa<Instruction>(Shift->getOperand(0))) {
             // Compute C << Y.
             Value *NS;
             if (Shift->getOpcode() == Instruction::Shr) {






More information about the llvm-commits mailing list