From 9737a7afc0745360c397362be68e1a639a488443 Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Wed, 10 Jul 2019 16:54:13 +0000 Subject: [PATCH] [NFC][InstCombine] Fixup some tests in just-added "omit mask before left-shift" tests git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365663 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../redundant-left-shift-input-masking-variant-a.ll | 10 ++++++---- .../redundant-left-shift-input-masking-variant-b.ll | 10 ++++++---- .../redundant-left-shift-input-masking-variant-f.ll | 5 +++-- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/test/Transforms/InstCombine/redundant-left-shift-input-masking-variant-a.ll b/test/Transforms/InstCombine/redundant-left-shift-input-masking-variant-a.ll index 5c0327695e9..e27efa65bbb 100644 --- a/test/Transforms/InstCombine/redundant-left-shift-input-masking-variant-a.ll +++ b/test/Transforms/InstCombine/redundant-left-shift-input-masking-variant-a.ll @@ -228,7 +228,8 @@ define i32 @t6_commutativity1(i32 %nbits0, i32 %nbits1) { ; CHECK-NEXT: call void @use32(i32 [[T3]]) ; CHECK-NEXT: call void @use32(i32 [[T4]]) ; CHECK-NEXT: call void @use32(i32 [[T5]]) -; CHECK-NEXT: ret i32 [[T4]] +; CHECK-NEXT: [[T6:%.*]] = shl i32 [[T4]], [[T5]] +; CHECK-NEXT: ret i32 [[T6]] ; %t0 = shl i32 1, %nbits0 %t1 = add nsw i32 %t0, -1 @@ -243,7 +244,7 @@ define i32 @t6_commutativity1(i32 %nbits0, i32 %nbits1) { call void @use32(i32 %t4) call void @use32(i32 %t5) %t6 = shl i32 %t4, %t5 - ret i32 %t4 + ret i32 %t6 } define i32 @t6_commutativity2(i32 %nbits0, i32 %nbits1) { ; CHECK-LABEL: @t6_commutativity2( @@ -259,7 +260,8 @@ define i32 @t6_commutativity2(i32 %nbits0, i32 %nbits1) { ; CHECK-NEXT: call void @use32(i32 [[T3]]) ; CHECK-NEXT: call void @use32(i32 [[T4]]) ; CHECK-NEXT: call void @use32(i32 [[T5]]) -; CHECK-NEXT: ret i32 [[T4]] +; CHECK-NEXT: [[T6:%.*]] = shl i32 [[T4]], [[T5]] +; CHECK-NEXT: ret i32 [[T6]] ; %t0 = shl i32 1, %nbits0 %t1 = add nsw i32 %t0, -1 @@ -274,7 +276,7 @@ define i32 @t6_commutativity2(i32 %nbits0, i32 %nbits1) { call void @use32(i32 %t4) call void @use32(i32 %t5) %t6 = shl i32 %t4, %t5 - ret i32 %t4 + ret i32 %t6 } ; Fast-math flags. We must not preserve them! diff --git a/test/Transforms/InstCombine/redundant-left-shift-input-masking-variant-b.ll b/test/Transforms/InstCombine/redundant-left-shift-input-masking-variant-b.ll index e0a3aee01ef..8e82ffe4639 100644 --- a/test/Transforms/InstCombine/redundant-left-shift-input-masking-variant-b.ll +++ b/test/Transforms/InstCombine/redundant-left-shift-input-masking-variant-b.ll @@ -228,7 +228,8 @@ define i32 @t6_commutativity1(i32 %nbits0, i32 %nbits1) { ; CHECK-NEXT: call void @use32(i32 [[T3]]) ; CHECK-NEXT: call void @use32(i32 [[T4]]) ; CHECK-NEXT: call void @use32(i32 [[T5]]) -; CHECK-NEXT: ret i32 [[T4]] +; CHECK-NEXT: [[T6:%.*]] = shl i32 [[T4]], [[T5]] +; CHECK-NEXT: ret i32 [[T6]] ; %t0 = shl i32 -1, %nbits0 %t1 = xor i32 %t0, -1 @@ -243,7 +244,7 @@ define i32 @t6_commutativity1(i32 %nbits0, i32 %nbits1) { call void @use32(i32 %t4) call void @use32(i32 %t5) %t6 = shl i32 %t4, %t5 - ret i32 %t4 + ret i32 %t6 } define i32 @t6_commutativity2(i32 %nbits0, i32 %nbits1) { ; CHECK-LABEL: @t6_commutativity2( @@ -259,7 +260,8 @@ define i32 @t6_commutativity2(i32 %nbits0, i32 %nbits1) { ; CHECK-NEXT: call void @use32(i32 [[T3]]) ; CHECK-NEXT: call void @use32(i32 [[T4]]) ; CHECK-NEXT: call void @use32(i32 [[T5]]) -; CHECK-NEXT: ret i32 [[T4]] +; CHECK-NEXT: [[T6:%.*]] = shl i32 [[T4]], [[T5]] +; CHECK-NEXT: ret i32 [[T6]] ; %t0 = shl i32 -1, %nbits0 %t1 = xor i32 %t0, -1 @@ -274,7 +276,7 @@ define i32 @t6_commutativity2(i32 %nbits0, i32 %nbits1) { call void @use32(i32 %t4) call void @use32(i32 %t5) %t6 = shl i32 %t4, %t5 - ret i32 %t4 + ret i32 %t6 } ; Fast-math flags. We must not preserve them! diff --git a/test/Transforms/InstCombine/redundant-left-shift-input-masking-variant-f.ll b/test/Transforms/InstCombine/redundant-left-shift-input-masking-variant-f.ll index 4414c0e7c2c..4b1cdb0b7cc 100644 --- a/test/Transforms/InstCombine/redundant-left-shift-input-masking-variant-f.ll +++ b/test/Transforms/InstCombine/redundant-left-shift-input-masking-variant-f.ll @@ -200,7 +200,8 @@ define i32 @n12(i32 %x, i32 %nbits) { ; CHECK-NEXT: call void @use32(i32 [[T0]]) ; CHECK-NEXT: call void @use32(i32 [[T1]]) ; CHECK-NEXT: call void @use32(i32 [[T2]]) -; CHECK-NEXT: ret i32 [[T2]] +; CHECK-NEXT: [[T3:%.*]] = shl i32 [[T1]], [[T2]] +; CHECK-NEXT: ret i32 [[T3]] ; %t0 = shl i32 %x, %nbits %t1 = ashr i32 %t0, %nbits @@ -209,5 +210,5 @@ define i32 @n12(i32 %x, i32 %nbits) { call void @use32(i32 %t1) call void @use32(i32 %t2) %t3 = shl i32 %t1, %t2 ; shift is smaller than mask - ret i32 %t2 + ret i32 %t3 } -- 2.40.0