llvm.org GIT mirror llvm / b5fefc7
A couple new regression tests to make sure we always pattern match the new opcodes on ppc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26256 91177308-0d34-0410-b5e6-96231b3b80d8 Nate Begeman 14 years ago
2 changed file(s) with 51 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; All of these ands and shifts should be folded into rlwimi's
1 ; RUN: llvm-as < %s | llc -march=ppc32 | grep addc | wc -l | grep 1 &&
2 ; RUN: llvm-as < %s | llc -march=ppc32 | grep adde | wc -l | grep 1 &&
3 ; RUN: llvm-as < %s | llc -march=ppc32 | grep addze | wc -l | grep 1 &&
4 ; RUN: llvm-as < %s | llc -march=ppc32 | grep addme | wc -l | grep 1 &&
5 ; RUN: llvm-as < %s | llc -march=ppc32 | grep addic | wc -l | grep 2
6
7 implementation ; Functions:
8
9 long %add_ll(long %a, long %b) {
10 entry:
11 %tmp.2 = add long %b, %a ; [#uses=1]
12 ret long %tmp.2
13 }
14
15 long %add_l_5(long %a) {
16 entry:
17 %tmp.1 = add long %a, 5 ; [#uses=1]
18 ret long %tmp.1
19 }
20
21 long %add_l_m5(long %a) {
22 entry:
23 %tmp.1 = add long %a, -5 ; [#uses=1]
24 ret long %tmp.1
25 }
0 ; All of these ands and shifts should be folded into rlwimi's
1 ; RUN: llvm-as < %s | llc -march=ppc32 | grep subfc | wc -l | grep 1 &&
2 ; RUN: llvm-as < %s | llc -march=ppc32 | grep subfe | wc -l | grep 1 &&
3 ; RUN: llvm-as < %s | llc -march=ppc32 | grep subfze | wc -l | grep 1 &&
4 ; RUN: llvm-as < %s | llc -march=ppc32 | grep subfme | wc -l | grep 1 &&
5 ; RUN: llvm-as < %s | llc -march=ppc32 | grep subfic | wc -l | grep 2
6 implementation ; Functions:
7
8 long %sub_ll(long %a, long %b) {
9 entry:
10 %tmp.2 = sub long %a, %b ; [#uses=1]
11 ret long %tmp.2
12 }
13
14 long %sub_l_5(long %a) {
15 entry:
16 %tmp.1 = sub long 5, %a ; [#uses=1]
17 ret long %tmp.1
18 }
19
20 long %sub_l_m5(long %a) {
21 entry:
22 %tmp.1 = sub long -5, %a ; [#uses=1]
23 ret long %tmp.1
24 }