Fix miscompilation of MallocBench/espresso which code review pointed out

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
This commit is contained in:
Chris Lattner 2006-10-20 18:20:21 +00:00
parent 3cb0f54ab5
commit 87d8429506

View 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.