llvm.org GIT mirror llvm / 2acfb17
Replace some more greps with FileChecks in tests git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174006 91177308-0d34-0410-b5e6-96231b3b80d8 Eli Bendersky 7 years ago
3 changed file(s) with 30 addition(s) and 22 deletion(s). Raw diff Collapse all Expand all
None ; RUN: llc < %s -march=x86-64 | grep lea | count 3
1 ; RUN: llc < %s -march=x86-64 | grep shl | count 1
2 ; RUN: llc < %s -march=x86-64 | not grep imul
0 ; RUN: llc < %s -march=x86-64 | FileCheck %s
1
2 ; CHECK-NOT: imul
33
44 define i64 @t1(i64 %a) nounwind readnone {
55 entry:
6 %0 = mul i64 %a, 81 ; [#uses=1]
7 ret i64 %0
6 %0 = mul i64 %a, 81
7 ; CHECK: lea
8 ; CHECK: lea
9 ret i64 %0
810 }
911
1012 define i64 @t2(i64 %a) nounwind readnone {
1113 entry:
12 %0 = mul i64 %a, 40 ; [#uses=1]
13 ret i64 %0
14 %0 = mul i64 %a, 40
15 ; CHECK: shl
16 ; CHECK: lea
17 ret i64 %0
1418 }
None ; RUN: llc < %s -march=x86 | grep lea
0 ; RUN: llc < %s -march=x86 | FileCheck %s
11
22 declare i32 @foo()
33
44 define i32 @test() {
5 %tmp.0 = tail call i32 @foo( ) ; [#uses=1]
6 %tmp.1 = mul i32 %tmp.0, 9 ; [#uses=1]
7 ret i32 %tmp.1
5 %tmp.0 = tail call i32 @foo( )
6 %tmp.1 = mul i32 %tmp.0, 9
7 ; CHECK-NOT: mul
8 ; CHECK: lea
9 ret i32 %tmp.1
810 }
911
None ; RUN: llc < %s -march=x86-64 | grep lea | count 2
0 ; RUN: llc < %s -march=x86-64 | FileCheck %s
11
22 define zeroext i16 @t1(i32 %on_off) nounwind {
33 entry:
4 %0 = sub i32 %on_off, 1
5 %1 = mul i32 %0, 2
6 %2 = trunc i32 %1 to i16
7 %3 = zext i16 %2 to i32
8 %4 = trunc i32 %3 to i16
9 ret i16 %4
4 %0 = sub i32 %on_off, 1
5 %1 = mul i32 %0, 2
6 %2 = trunc i32 %1 to i16
7 %3 = zext i16 %2 to i32
8 %4 = trunc i32 %3 to i16
9 ; CHECK: lea
10 ret i16 %4
1011 }
1112
1213 define i32 @t2(i32 %on_off) nounwind {
1314 entry:
14 %0 = sub i32 %on_off, 1
15 %1 = mul i32 %0, 2
16 %2 = and i32 %1, 65535
17 ret i32 %2
15 %0 = sub i32 %on_off, 1
16 %1 = mul i32 %0, 2
17 %2 = and i32 %1, 65535
18 ; CHECK: lea
19 ret i32 %2
1820 }