forked from OSchip/llvm-project
For PR1271:
Fix SingleSource/Regression/C/2003-05-21-UnionBitFields.c by changing a getHighBitsSet call to getLowBitsSet call that was incorrectly converted from the original lshr constant expression. llvm-svn: 35348
This commit is contained in:
parent
e5866e7b89
commit
50898607a9
|
@ -5858,7 +5858,7 @@ Instruction *InstCombiner::FoldShiftByConstant(Value *Op0, ConstantInt *Op1,
|
|||
BinaryOperator::createLShr(X, ConstantInt::get(Ty, ShiftDiff));
|
||||
InsertNewInstBefore(Shift, I);
|
||||
|
||||
APInt Mask(APInt::getHighBitsSet(TypeBits, TypeBits - ShiftAmt2));
|
||||
APInt Mask(APInt::getLowBitsSet(TypeBits, ShiftAmt2));
|
||||
return BinaryOperator::createAnd(Shift, ConstantInt::get(Mask));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue