For PR1271:
authorReid Spencer <rspencer@reidspencer.com>
Mon, 26 Mar 2007 23:45:51 +0000 (23:45 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Mon, 26 Mar 2007 23:45:51 +0000 (23:45 +0000)
Fix another incorrectly converted shift mask.

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

lib/Transforms/Scalar/InstructionCombining.cpp

index 3c06558d15b23bd0395759fec342be0b208e0624..b7c14c6f003c3ab60bbdc6e70ba6efa8f783aaf3 100644 (file)
@@ -5887,7 +5887,7 @@ Instruction *InstCombiner::FoldShiftByConstant(Value *Op0, ConstantInt *Op1,
           BinaryOperator::createShl(X, ConstantInt::get(Ty, ShiftDiff));
         InsertNewInstBefore(Shift, I);
         
-        APInt Mask(APInt::getHighBitsSet(TypeBits, TypeBits - ShiftAmt2));
+        APInt Mask(APInt::getLowBitsSet(TypeBits, TypeBits - ShiftAmt2));
         return BinaryOperator::createAnd(Shift, ConstantInt::get(Mask));
       }