New testcase, neither should require a register-register copy
[oota-llvm.git] / test / CodeGen / PowerPC / rlwimi-commute.ll
1 ; RUN: llvm-as < %s | llc -march=ppc32 | grep rlwimi &&
2 ; RUN: llvm-as < %s | llc -march=ppc32 | not grep 'or '
3
4 ; Make sure there is no register-register copies here.
5
6 void %test1(int *%A, int *%B, int *%D, int* %E) {
7         %A = load int* %A
8         %B = load int* %B
9         %X = and int %A, 15
10         %Y = and int %B, -16
11         %Z = or int %X, %Y
12         store int %Z, int* %D
13         store int %A, int* %E
14         ret void
15 }
16
17 void %test2(int *%A, int *%B, int *%D, int* %E) {
18         %A = load int* %A
19         %B = load int* %B
20         %X = and int %A, 15
21         %Y = and int %B, -16
22         %Z = or int %X, %Y
23         store int %Z, int* %D
24         store int %B, int* %E
25         ret void
26 }