@@ -310,9 +310,8 @@ define i32 @test_umin_shl_no_nuw_flag(i32 %x, i32 %y) {
310310define i32 @test_umax_shl_preserve_nsw (i32 %base , i32 %x , i32 %y ) {
311311; CHECK-LABEL: define i32 @test_umax_shl_preserve_nsw(
312312; CHECK-SAME: i32 [[BASE:%.*]], i32 [[X:%.*]], i32 [[Y:%.*]]) {
313- ; CHECK-NEXT: [[SHL_X:%.*]] = shl nuw nsw i32 [[BASE]], [[X]]
314- ; CHECK-NEXT: [[SHL_Y:%.*]] = shl nuw nsw i32 [[BASE]], [[Y]]
315- ; CHECK-NEXT: [[MAX:%.*]] = call i32 @llvm.umax.i32(i32 [[SHL_X]], i32 [[SHL_Y]])
313+ ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.umax.i32(i32 [[X]], i32 [[Y]])
314+ ; CHECK-NEXT: [[MAX:%.*]] = shl nuw nsw i32 [[BASE]], [[TMP1]]
316315; CHECK-NEXT: ret i32 [[MAX]]
317316;
318317 %shl_x = shl nuw nsw i32 %base , %x
@@ -324,9 +323,8 @@ define i32 @test_umax_shl_preserve_nsw(i32 %base, i32 %x, i32 %y) {
324323define i32 @test_umin_shl_preserve_nsw (i32 %base , i32 %x , i32 %y ) {
325324; CHECK-LABEL: define i32 @test_umin_shl_preserve_nsw(
326325; CHECK-SAME: i32 [[BASE:%.*]], i32 [[X:%.*]], i32 [[Y:%.*]]) {
327- ; CHECK-NEXT: [[SHL_X:%.*]] = shl nuw nsw i32 [[BASE]], [[X]]
328- ; CHECK-NEXT: [[SHL_Y:%.*]] = shl nuw nsw i32 [[BASE]], [[Y]]
329- ; CHECK-NEXT: [[MIN:%.*]] = call i32 @llvm.umin.i32(i32 [[SHL_X]], i32 [[SHL_Y]])
326+ ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.umin.i32(i32 [[X]], i32 [[Y]])
327+ ; CHECK-NEXT: [[MIN:%.*]] = shl nuw nsw i32 [[BASE]], [[TMP1]]
330328; CHECK-NEXT: ret i32 [[MIN]]
331329;
332330 %shl_x = shl nuw nsw i32 %base , %x
0 commit comments