@@ -1078,15 +1078,14 @@ SDValue DAGTypeLegalizer::PromoteIntRes_ADDSUBSHLSAT(SDNode *N) {
1078
1078
bool IsShift = Opcode == ISD::USHLSAT || Opcode == ISD::SSHLSAT;
1079
1079
1080
1080
// FIXME: We need vp-aware PromotedInteger functions.
1081
- SDValue Op1Promoted, Op2Promoted;
1082
1081
if (IsShift) {
1083
- Op1Promoted = GetPromotedInteger (Op1);
1084
- Op2Promoted = ZExtPromotedInteger (Op2);
1082
+ Op1 = GetPromotedInteger (Op1);
1083
+ Op2 = ZExtPromotedInteger (Op2);
1085
1084
} else {
1086
- Op1Promoted = SExtPromotedInteger (Op1);
1087
- Op2Promoted = SExtPromotedInteger (Op2);
1085
+ Op1 = SExtPromotedInteger (Op1);
1086
+ Op2 = SExtPromotedInteger (Op2);
1088
1087
}
1089
- EVT PromotedType = Op1Promoted .getValueType ();
1088
+ EVT PromotedType = Op1 .getValueType ();
1090
1089
unsigned NewBits = PromotedType.getScalarSizeInBits ();
1091
1090
1092
1091
// Shift cannot use a min/max expansion, we can't detect overflow if all of
@@ -1110,14 +1109,11 @@ SDValue DAGTypeLegalizer::PromoteIntRes_ADDSUBSHLSAT(SDNode *N) {
1110
1109
unsigned SHLAmount = NewBits - OldBits;
1111
1110
SDValue ShiftAmount =
1112
1111
DAG.getShiftAmountConstant (SHLAmount, PromotedType, dl);
1113
- Op1Promoted =
1114
- DAG.getNode (ISD::SHL, dl, PromotedType, Op1Promoted, ShiftAmount);
1112
+ Op1 = DAG.getNode (ISD::SHL, dl, PromotedType, Op1, ShiftAmount);
1115
1113
if (!IsShift)
1116
- Op2Promoted =
1117
- matcher.getNode (ISD::SHL, dl, PromotedType, Op2Promoted, ShiftAmount);
1114
+ Op2 = matcher.getNode (ISD::SHL, dl, PromotedType, Op2, ShiftAmount);
1118
1115
1119
- SDValue Result =
1120
- matcher.getNode (Opcode, dl, PromotedType, Op1Promoted, Op2Promoted);
1116
+ SDValue Result = matcher.getNode (Opcode, dl, PromotedType, Op1, Op2);
1121
1117
return matcher.getNode (ShiftOp, dl, PromotedType, Result, ShiftAmount);
1122
1118
}
1123
1119
@@ -1126,8 +1122,7 @@ SDValue DAGTypeLegalizer::PromoteIntRes_ADDSUBSHLSAT(SDNode *N) {
1126
1122
APInt MaxVal = APInt::getSignedMaxValue (OldBits).sext (NewBits);
1127
1123
SDValue SatMin = DAG.getConstant (MinVal, dl, PromotedType);
1128
1124
SDValue SatMax = DAG.getConstant (MaxVal, dl, PromotedType);
1129
- SDValue Result =
1130
- matcher.getNode (AddOp, dl, PromotedType, Op1Promoted, Op2Promoted);
1125
+ SDValue Result = matcher.getNode (AddOp, dl, PromotedType, Op1, Op2);
1131
1126
Result = matcher.getNode (ISD::SMIN, dl, PromotedType, Result, SatMax);
1132
1127
Result = matcher.getNode (ISD::SMAX, dl, PromotedType, Result, SatMin);
1133
1128
return Result;
0 commit comments