@@ -5,7 +5,7 @@ define i8 @add_and_sgt(i8 %x) {
55; CHECK-LABEL: define i8 @add_and_sgt(
66; CHECK-SAME: i8 [[X:%.*]]) {
77; CHECK-NEXT: [[TMP1:%.*]] = call i8 @llvm.smax.i8(i8 [[X]], i8 8)
8- ; CHECK-NEXT: [[S:%.*]] = add nuw i8 [[TMP1]], 16
8+ ; CHECK-NEXT: [[S:%.*]] = add nuw nsw i8 [[TMP1]], 16
99; CHECK-NEXT: ret i8 [[S]]
1010;
1111 %add = add nsw i8 %x , 16
@@ -155,7 +155,7 @@ define i8 @multi_use_cond_and_sel(i8 %x) {
155155; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i8 [[X]], 8
156156; CHECK-NEXT: call void @use(i1 [[CMP]])
157157; CHECK-NEXT: [[TMP1:%.*]] = call i8 @llvm.smax.i8(i8 [[X]], i8 8)
158- ; CHECK-NEXT: [[S:%.*]] = add nuw i8 [[TMP1]], 16
158+ ; CHECK-NEXT: [[S:%.*]] = add nuw nsw i8 [[TMP1]], 16
159159; CHECK-NEXT: call void @use_byte(i8 [[S]])
160160; CHECK-NEXT: ret i8 [[S]]
161161;
@@ -455,7 +455,7 @@ define i8 @add_sgt_nuw_nsw_safe(i8 %x) {
455455; CHECK-LABEL: define i8 @add_sgt_nuw_nsw_safe(
456456; CHECK-SAME: i8 [[X:%.*]]) {
457457; CHECK-NEXT: [[TMP1:%.*]] = call i8 @llvm.smin.i8(i8 [[X]], i8 100)
458- ; CHECK-NEXT: [[S:%.*]] = add nsw i8 [[TMP1]], 1
458+ ; CHECK-NEXT: [[S:%.*]] = add nuw nsw i8 [[TMP1]], 1
459459; CHECK-NEXT: ret i8 [[S]]
460460;
461461 %add = add nuw nsw i8 %x , 1
@@ -468,7 +468,7 @@ define i8 @add_sgt_nuw_only(i8 %x) {
468468; CHECK-LABEL: define i8 @add_sgt_nuw_only(
469469; CHECK-SAME: i8 [[X:%.*]]) {
470470; CHECK-NEXT: [[TMP1:%.*]] = call i8 @llvm.smin.i8(i8 [[X]], i8 100)
471- ; CHECK-NEXT: [[S:%.*]] = add i8 [[TMP1]], 50
471+ ; CHECK-NEXT: [[S:%.*]] = add nuw i8 [[TMP1]], 50
472472; CHECK-NEXT: ret i8 [[S]]
473473;
474474 %add = add nuw nsw i8 %x , 50
@@ -481,7 +481,7 @@ define i8 @add_sgt_nsw_only(i8 %x) {
481481; CHECK-LABEL: define i8 @add_sgt_nsw_only(
482482; CHECK-SAME: i8 [[X:%.*]]) {
483483; CHECK-NEXT: [[TMP1:%.*]] = call i8 @llvm.smin.i8(i8 [[X]], i8 100)
484- ; CHECK-NEXT: [[S:%.*]] = add i8 [[TMP1]], -99
484+ ; CHECK-NEXT: [[S:%.*]] = add nsw i8 [[TMP1]], -99
485485; CHECK-NEXT: ret i8 [[S]]
486486;
487487 %add = add nuw nsw i8 %x , -99
@@ -495,7 +495,7 @@ define i8 @mul_ult_nuw_nsw_safe(i8 %x) {
495495; CHECK-LABEL: define i8 @mul_ult_nuw_nsw_safe(
496496; CHECK-SAME: i8 [[X:%.*]]) {
497497; CHECK-NEXT: [[TMP1:%.*]] = call i8 @llvm.umax.i8(i8 [[X]], i8 10)
498- ; CHECK-NEXT: [[S:%.*]] = mul i8 [[TMP1]], 3
498+ ; CHECK-NEXT: [[S:%.*]] = mul nuw nsw i8 [[TMP1]], 3
499499; CHECK-NEXT: ret i8 [[S]]
500500;
501501 %mul = mul nuw nsw i8 %x , 3
@@ -508,7 +508,7 @@ define i8 @mul_ult_nuw_only(i8 %x) {
508508; CHECK-LABEL: define i8 @mul_ult_nuw_only(
509509; CHECK-SAME: i8 [[X:%.*]]) {
510510; CHECK-NEXT: [[TMP1:%.*]] = call i8 @llvm.umax.i8(i8 [[X]], i8 10)
511- ; CHECK-NEXT: [[S:%.*]] = mul i8 [[TMP1]], 25
511+ ; CHECK-NEXT: [[S:%.*]] = mul nuw i8 [[TMP1]], 25
512512; CHECK-NEXT: ret i8 [[S]]
513513;
514514 %mul = mul nuw nsw i8 %x , 25
@@ -521,7 +521,7 @@ define i8 @mul_ult_nsw_only(i8 %x) {
521521; CHECK-LABEL: define i8 @mul_ult_nsw_only(
522522; CHECK-SAME: i8 [[X:%.*]]) {
523523; CHECK-NEXT: [[TMP1:%.*]] = call i8 @llvm.umax.i8(i8 [[X]], i8 40)
524- ; CHECK-NEXT: [[S:%.*]] = mul i8 [[TMP1]], -2
524+ ; CHECK-NEXT: [[S:%.*]] = mul nsw i8 [[TMP1]], -2
525525; CHECK-NEXT: ret i8 [[S]]
526526;
527527 %mul = mul nuw nsw i8 %x , -2
0 commit comments