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

Chris Lattner lattner at cs.uiuc.edu
Tue Feb 7 11:07:52 PST 2006



Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.422 -> 1.423
---
Log message:

Fix Transforms/InstCombine/2006-02-07-SextZextCrash.ll


---
Diffs of the changes:  (+5 -3)

 InstructionCombining.cpp |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.422 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.423
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.422	Tue Feb  7 02:05:22 2006
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp	Tue Feb  7 13:07:40 2006
@@ -563,10 +563,12 @@
       // extend instead of a sign extend.
       if ((Mask & ((1ULL << SrcBits)-1)) == 0) {
         // Convert to unsigned first.
-        Value *NewVal;
+        Instruction *NewVal;
         NewVal = new CastInst(I->getOperand(0), SrcTy->getUnsignedVersion(),
-                              I->getOperand(0)->getName(), I);
-        NewVal = new CastInst(I->getOperand(0), I->getType(), I->getName());
+                              I->getOperand(0)->getName());
+        InsertNewInstBefore(NewVal, *I);
+        NewVal = new CastInst(NewVal, I->getType(), I->getName());
+        InsertNewInstBefore(NewVal, *I);
         return UpdateValueUsesWith(I, NewVal);
       }
 






More information about the llvm-commits mailing list