llvm.org GIT mirror llvm / e7d845b
[PowerPC] Add another test for load/store with update We now produce the desired code as noted in the README.txt file. Remove the README entry and add a regression test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225205 91177308-0d34-0410-b5e6-96231b3b80d8 Hal Finkel 5 years ago
2 changed file(s) with 19 addition(s) and 34 deletion(s). Raw diff Collapse all Expand all
2727 add r3, r3, r4
2828
2929 Ick.
30
31 ===-------------------------------------------------------------------------===
32
33 Support 'update' load/store instructions. These are cracked on the G5, but are
34 still a codesize win.
35
36 With preinc enabled, this:
37
38 long *%test4(long *%X, long *%dest) {
39 %Y = getelementptr long* %X, int 4
40 %A = load long* %Y
41 store long %A, long* %dest
42 ret long* %Y
43 }
44
45 compiles to:
46
47 _test4:
48 mr r2, r3
49 lwzu r5, 32(r2)
50 lwz r3, 36(r3)
51 stw r5, 0(r4)
52 stw r3, 4(r4)
53 mr r3, r2
54 blr
55
56 with -sched=list-burr, I get:
57
58 _test4:
59 lwz r2, 36(r3)
60 lwzu r5, 32(r3)
61 stw r2, 4(r4)
62 stw r5, 0(r4)
63 blr
6430
6531 ===-------------------------------------------------------------------------===
6632
0 ; RUN: llc -mcpu=pwr7 < %s | FileCheck %s
1 target datalayout = "E-m:e-i64:64-n32:64"
2 target triple = "powerpc-unknown-linux-gnu"
3
4 ; Function Attrs: nounwind
5 define i32* @test4(i32* readonly %X, i32* nocapture %dest) #0 {
6 %Y = getelementptr i32* %X, i64 4
7 %A = load i32* %Y, align 4
8 store i32 %A, i32* %dest, align 4
9 ret i32* %Y
10
11 ; CHECK-LABEL: @test4
12 ; CHECK: lwzu [[REG1:[0-9]+]], 16(3)
13 ; CHECK: stw [[REG1]], 0(4)
14 ; CHECK: blr
15 }
16
17 attributes #0 = { nounwind }
18