Skip to content

Commit 97b12df

Browse files
committed
[Reassociate] shifttest.ll - generate test checks to replace custom grep expression
(and remove an unused argument)
1 parent 716ed5f commit 97b12df

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed
Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2+
; RUN: opt < %s -passes=reassociate,instcombine -S | FileCheck %s
3+
14
; With shl->mul reassociation, we can see that this is (shl A, 9) * A
5+
define i32 @test(i32 %A) {
6+
; CHECK-LABEL: define i32 @test(
7+
; CHECK-SAME: i32 [[A:%.*]]) {
8+
; CHECK-NEXT: [[Y:%.*]] = shl i32 [[A]], 9
9+
; CHECK-NEXT: [[Z:%.*]] = mul i32 [[Y]], [[A]]
10+
; CHECK-NEXT: ret i32 [[Z]]
211
;
3-
; RUN: opt < %s -passes=reassociate,instcombine -S |\
4-
; RUN: grep "shl .*, 9"
5-
6-
define i32 @test(i32 %A, i32 %B) {
7-
%X = shl i32 %A, 5 ; <i32> [#uses=1]
8-
%Y = shl i32 %A, 4 ; <i32> [#uses=1]
9-
%Z = mul i32 %Y, %X ; <i32> [#uses=1]
10-
ret i32 %Z
12+
%X = shl i32 %A, 5 ; <i32> [#uses=1]
13+
%Y = shl i32 %A, 4 ; <i32> [#uses=1]
14+
%Z = mul i32 %Y, %X ; <i32> [#uses=1]
15+
ret i32 %Z
1116
}
1217

0 commit comments

Comments
 (0)