Fix a type violation

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17069 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2004-10-16 23:28:04 +00:00
parent 2d4c98d79b
commit 79a564caa7

View File

@ -2516,7 +2516,7 @@ Instruction *InstCombiner::visitShiftInst(ShiftInst &I) {
if (isa<UndefValue>(Op0)) { // undef >>s X -> undef if (isa<UndefValue>(Op0)) { // undef >>s X -> undef
if (!isLeftShift && I.getType()->isSigned()) if (!isLeftShift && I.getType()->isSigned())
return ReplaceInstUsesWith(I, Op1); return ReplaceInstUsesWith(I, Op0);
else // undef << X -> 0 AND undef >>u X -> 0 else // undef << X -> 0 AND undef >>u X -> 0
return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType())); return ReplaceInstUsesWith(I, Constant::getNullValue(I.getType()));
} }