Fix miscompilation of MallocBench/espresso which code review pointed out
authorChris Lattner <sabre@nondot.org>
Fri, 20 Oct 2006 18:20:21 +0000 (18:20 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 20 Oct 2006 18:20:21 +0000 (18:20 +0000)
but apparently didn't make it into the final patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31070 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/InstructionCombining.cpp

index c30c0c924f855a09b47485e100384e37633f2b30..bcb4888b6aeb920feb4ba5789f8bdf516a5c4733 100644 (file)
@@ -4913,7 +4913,7 @@ Instruction *InstCombiner::visitShiftInst(ShiftInst &I) {
   // shr int -1, X = -1   (for any arithmetic shift rights of ~0)
   if (!isLeftShift)
     if (ConstantInt *CSI = dyn_cast<ConstantInt>(Op0))
-      if (CSI->isAllOnesValue())
+      if (CSI->isAllOnesValue() && Op0->getType()->isSigned())
         return ReplaceInstUsesWith(I, CSI);
 
   // Try to fold constant and into select arguments.