1 # RUN: llc -mtriple=powerpc64le--linux-gnu -stop-after ppc-pre-emit-peephole %s -o - -verify-machineinstrs | FileCheck %s
4 # LI + XFORM -> DFORM, no killed/dead flag fixup.
5 name: testKillPassUpLI1
6 #CHECK: name: testKillPassUpLI1
7 tracksRegLiveness: true
10 liveins: $x3, $f1, $x5
12 STFSX killed $f1, $x3, $x5
13 ; CHECK: STFS killed $f1, 100, $x5
14 STD killed $x3, killed $x5, 100
15 ; CHECK: STD killed $x3, killed $x5, 100
16 BLR8 implicit $lr8, implicit $rm
20 # LI + XFORM -> DFORM, fixup killed/dead flag for $x3, find no use, set def as
21 # dead(LI8 is deleted).
22 name: testKillPassUpLI2
23 # CHECK: name: testKillPassUpLI2
24 tracksRegLiveness: true
27 liveins: $x3, $f1, $x5
30 STFSX killed $f1, killed $x3, killed $x5
31 ; CHECK: STFS killed $f1, 100, killed $x5
32 BLR8 implicit $lr8, implicit $rm
36 # LI + XFORM -> DFORM, fixup killed/dead flag for $x3, find last use, set last
38 name: testKillPassUpLI3
39 # CHECK: name: testKillPassUpLI3
40 tracksRegLiveness: true
43 liveins: $x3, $f1, $x5
46 ; CHECK: STD killed $x3, $x5, 100
47 STFSX killed $f1, killed $x3, $x5
48 ; CHECK: STFS killed $f1, 100, $x5
49 STD killed $x5, $x5, 100
50 ; CHECK: STD killed $x5, killed $x5, 100
51 BLR8 implicit $lr8, implicit $rm
55 # LI + OP -> LI, fixup killed/dead flag for $x3, find last use, set last use as
57 name: testKillPassUpLI4
58 # CHECK: name: testKillPassUpLI4
59 tracksRegLiveness: true
65 ; CHECK: STD killed $x3, killed $x5, 100
66 $x5 = ADDI8 killed $x3, 200
67 ; CHECK: $x5 = LI8 300
69 BLR8 implicit $lr8, implicit $rm
73 # ADD + XFORM -> DFORM, fixup killed/dead flag for $x3, find no use, set def as dead
75 name: testKillPassUpADD1
76 # CHECK: name: testKillPassUpADD1
77 tracksRegLiveness: true
80 liveins: $x3, $f1, $x5
81 $x3 = ADDI8 killed $x5, 100
83 STFSX killed $f1, $zero8, killed $x3
84 ; CHECK: STFS killed $f1, 100, killed $x5
85 BLR8 implicit $lr8, implicit $rm
89 # ADD + XFORM -> DFORM, fixup killed/dead flag for $x3, find last use, set last
91 name: testKillPassUpADD2
92 # CHECK: name: testKillPassUpADD2
93 tracksRegLiveness: true
96 liveins: $x3, $f1, $x5
99 ; CHECK: STD killed $x3, $x5, 100
100 STFSX killed $f1, $zero8, killed $x3
101 ; CHECK: STFS killed $f1, 100, $x5
102 STD killed $x5, $x5, 100
103 ; CHECK: STD killed $x5, killed $x5, 100
104 BLR8 implicit $lr8, implicit $rm
108 # ADD + XFORM -> DFORM, fixup killed/dead flag for register $x5, DFORM
109 # instruction uses $x5 and no other kill uses, set it as killed in
111 name: testKillPassDownADD1
112 # CHECK: name: testKillPassDownADD1
113 tracksRegLiveness: true
116 liveins: $x3, $f1, $x5
117 $x3 = ADDI8 killed $x5, 100
118 ; CHECK: $x3 = ADDI8 $x5, 100
119 STFSX killed $f1, $zero8, $x3
120 ; CHECK: STFS killed $f1, 100, killed $x5
121 STD killed $x3, $x3, 100
122 ; CHECK: STD killed $x3, killed $x3, 100
123 BLR8 implicit $lr8, implicit $rm
127 # ADD + XFORM -> DFORM, fixup killed/dead flag for register $x5, DFORM
128 # instruction uses $x5 and there is one kill use, set $x5 as killed in
129 # DFORM instruction and clear the other kill use killed flag.
130 name: testKillPassDownADD2
131 # CHECK: name: testKillPassDownADD2
132 tracksRegLiveness: true
135 liveins: $x3, $f1, $x5
137 STD killed $x5, $x5, 100
138 ; CHECK: STD $x5, $x5, 100
139 STFSX killed $f1, $zero8, killed $x3
140 ; CHECK: STFS killed $f1, 100, killed $x5
141 BLR8 implicit $lr8, implicit $rm
145 # ADD + XFORM -> DFORM, fixup killed/dead flag for register $x3, DFORM
146 # instruction defines $x3, do nothing for killed/dead flag.
147 name: testKillPassDownADD3
148 # CHECK: name: testKillPassDownADD3
149 tracksRegLiveness: true
154 $x3 = LDX $zero8, killed $x3
155 ; CHECK: $x3 = LD 100, $x5
156 STD killed $x5, $x5, 100
157 ; CHECK: STD killed $x5, killed $x5, 100
158 STD killed $x3, $x3, 200
159 ; CHECK: STD killed $x3, killed $x3, 200
160 BLR8 implicit $lr8, implicit $rm
164 # ADD + XFORM -> DFORM, fixup killed/dead flag for both register $x5 and $x3,
165 # DFORM instruction uses $x5 and there is one kill use, set $x5 as killed in
166 # DFORM instruction and clear the other kill use killed flag. Find last use for
167 # $x3, set last use as killed.
168 name: testKillPassDownADD4
169 # CHECK: name: testKillPassDownADD4
170 tracksRegLiveness: true
173 liveins: $x3, $f1, $x5
175 STD killed $x5, $x5, 100
176 ; CHECK: STD $x5, $x5, 100
178 ; CHECK: STD killed $x3, killed $x3, 200
179 STFSX killed $f1, $zero8, killed $x3
180 ; CHECK: STFS killed $f1, 100, killed $x5
181 BLR8 implicit $lr8, implicit $rm