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

Lauro Ramos Venancio lauro.venancio at gmail.com
Wed Jun 6 10:09:06 PDT 2007



Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.768 -> 1.769
---
Log message:

Fix PR1499: http://llvm.org/PR1499 .



---
Diffs of the changes:  (+4 -0)

 InstructionCombining.cpp |    4 ++++
 1 files changed, 4 insertions(+)


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.768 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.769
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.768	Tue May 22 20:17:04 2007
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp	Wed Jun  6 12:08:48 2007
@@ -1346,6 +1346,10 @@
       
       // Signed shift right.
       APInt DemandedMaskIn(DemandedMask.shl(ShiftAmt));
+      // If any of the "high bits" are demanded, we should set the sign bit as
+      // demanded.
+      if (DemandedMask.countLeadingZeros() <= ShiftAmt)
+        DemandedMaskIn.set(BitWidth-1);
       if (SimplifyDemandedBits(I->getOperand(0),
                                DemandedMaskIn,
                                RHSKnownZero, RHSKnownOne, Depth+1))






More information about the llvm-commits mailing list