@@ -1033,24 +1033,25 @@ static bool setShiftFlags(BinaryOperator &I, const SimplifyQuery &Q) {
1033
1033
}
1034
1034
1035
1035
static Instruction *transformClampedShift64 (BinaryOperator &I,
1036
- const SimplifyQuery &Q,
1037
- InstCombiner::BuilderTy &Builder) {
1036
+ const SimplifyQuery &Q,
1037
+ InstCombiner::BuilderTy &Builder) {
1038
1038
Value *Op0 = I.getOperand (0 ), *Op1 = I.getOperand (1 );
1039
1039
Type *I32Type = Type::getInt32Ty (I.getContext ());
1040
1040
Type *I64Type = Type::getInt64Ty (I.getContext ());
1041
1041
1042
1042
if (I.getType () == I64Type) {
1043
1043
KnownBits KnownAmt = computeKnownBits (Op1, /* Depth */ 0 , Q);
1044
1044
if (KnownAmt.getMinValue ().uge (32 )) {
1045
- Value *TruncVal = Builder.CreateTrunc (Op0, I32Type);
1046
- Value *TruncShiftAmt = Builder.CreateTrunc (Op1, I32Type);
1047
- Value *AdjustedShiftAmt = Builder.CreateSub (TruncShiftAmt,
1048
- ConstantInt::get (I32Type, 32 ));
1049
- Value *Shl32 = Builder.CreateShl (TruncVal, AdjustedShiftAmt);
1050
- Value *VResult = Builder.CreateVectorSplat (2 , ConstantInt::get (I32Type, 0 ));
1045
+ Value *TruncVal = Builder.CreateTrunc (Op0, I32Type);
1046
+ Value *TruncShiftAmt = Builder.CreateTrunc (Op1, I32Type);
1047
+ Value *AdjustedShiftAmt =
1048
+ Builder.CreateSub (TruncShiftAmt, ConstantInt::get (I32Type, 32 ));
1049
+ Value *Shl32 = Builder.CreateShl (TruncVal, AdjustedShiftAmt);
1050
+ Value *VResult =
1051
+ Builder.CreateVectorSplat (2 , ConstantInt::get (I32Type, 0 ));
1051
1052
1052
1053
VResult = Builder.CreateInsertElement (VResult, Shl32,
1053
- ConstantInt::get (I32Type, 1 ));
1054
+ ConstantInt::get (I32Type, 1 ));
1054
1055
return CastInst::Create (Instruction::BitCast, VResult, I64Type);
1055
1056
}
1056
1057
}
0 commit comments