@@ -43,8 +43,8 @@ define i8 @add_shl_same_amount_nsw_extra_use1(i8 %x, i8 %y, i8 %z) {
4343; CHECK-LABEL: @add_shl_same_amount_nsw_extra_use1(
4444; CHECK-NEXT: [[XS:%.*]] = shl nuw nsw i8 [[X:%.*]], [[Z:%.*]]
4545; CHECK-NEXT: call void @use8(i8 [[XS]])
46- ; CHECK-NEXT: [[TMP1 :%.*]] = add nsw i8 [[X ]], [[Y:%.* ]]
47- ; CHECK-NEXT: [[DIFF:%.*]] = shl nsw i8 [[TMP1 ]], [[Z ]]
46+ ; CHECK-NEXT: [[YS :%.*]] = shl nuw nsw i8 [[Y:%.* ]], [[Z ]]
47+ ; CHECK-NEXT: [[DIFF:%.*]] = add nsw i8 [[XS ]], [[YS ]]
4848; CHECK-NEXT: ret i8 [[DIFF]]
4949;
5050 %xs = shl nsw nuw i8 %x , %z
@@ -56,10 +56,10 @@ define i8 @add_shl_same_amount_nsw_extra_use1(i8 %x, i8 %y, i8 %z) {
5656
5757define i8 @add_shl_same_amount_nuw_extra_use2 (i8 %x , i8 %y , i8 %z ) {
5858; CHECK-LABEL: @add_shl_same_amount_nuw_extra_use2(
59- ; CHECK-NEXT: [[YS:%.*]] = shl nuw nsw i8 [[Y:%.*]], [[Z:%.*]]
59+ ; CHECK-NEXT: [[XS:%.*]] = shl nuw i8 [[X:%.*]], [[Z:%.*]]
60+ ; CHECK-NEXT: [[YS:%.*]] = shl nuw nsw i8 [[Y:%.*]], [[Z]]
6061; CHECK-NEXT: call void @use8(i8 [[YS]])
61- ; CHECK-NEXT: [[TMP1:%.*]] = add nuw i8 [[X:%.*]], [[Y]]
62- ; CHECK-NEXT: [[DIFF:%.*]] = shl nuw i8 [[TMP1]], [[Z]]
62+ ; CHECK-NEXT: [[DIFF:%.*]] = add nuw nsw i8 [[XS]], [[YS]]
6363; CHECK-NEXT: ret i8 [[DIFF]]
6464;
6565 %xs = shl nuw i8 %x , %z
@@ -174,8 +174,8 @@ define i8 @sub_shl_same_amount_nsw_extra_use1(i8 %x, i8 %y, i8 %z) {
174174; CHECK-LABEL: @sub_shl_same_amount_nsw_extra_use1(
175175; CHECK-NEXT: [[XS:%.*]] = shl nuw nsw i8 [[X:%.*]], [[Z:%.*]]
176176; CHECK-NEXT: call void @use8(i8 [[XS]])
177- ; CHECK-NEXT: [[TMP1 :%.*]] = sub nsw i8 [[X ]], [[Y:%.* ]]
178- ; CHECK-NEXT: [[DIFF:%.*]] = shl nsw i8 [[TMP1 ]], [[Z ]]
177+ ; CHECK-NEXT: [[YS :%.*]] = shl nuw nsw i8 [[Y:%.* ]], [[Z ]]
178+ ; CHECK-NEXT: [[DIFF:%.*]] = sub nsw i8 [[XS ]], [[YS ]]
179179; CHECK-NEXT: ret i8 [[DIFF]]
180180;
181181 %xs = shl nsw nuw i8 %x , %z
@@ -187,10 +187,10 @@ define i8 @sub_shl_same_amount_nsw_extra_use1(i8 %x, i8 %y, i8 %z) {
187187
188188define i8 @sub_shl_same_amount_nuw_extra_use2 (i8 %x , i8 %y , i8 %z ) {
189189; CHECK-LABEL: @sub_shl_same_amount_nuw_extra_use2(
190- ; CHECK-NEXT: [[YS:%.*]] = shl nuw nsw i8 [[Y:%.*]], [[Z:%.*]]
190+ ; CHECK-NEXT: [[XS:%.*]] = shl nuw i8 [[X:%.*]], [[Z:%.*]]
191+ ; CHECK-NEXT: [[YS:%.*]] = shl nuw nsw i8 [[Y:%.*]], [[Z]]
191192; CHECK-NEXT: call void @use8(i8 [[YS]])
192- ; CHECK-NEXT: [[TMP1:%.*]] = sub nuw i8 [[X:%.*]], [[Y]]
193- ; CHECK-NEXT: [[DIFF:%.*]] = shl nuw i8 [[TMP1]], [[Z]]
193+ ; CHECK-NEXT: [[DIFF:%.*]] = sub nuw nsw i8 [[XS]], [[YS]]
194194; CHECK-NEXT: ret i8 [[DIFF]]
195195;
196196 %xs = shl nuw i8 %x , %z
0 commit comments