1 # RUN: llc -mtriple=s390x-linux-gnu -mcpu=z14 -start-before=greedy %s -o - \
4 # Test folding of a memory operand into logical compare with an immediate.
7 define i32 @fun0(i32* %src, i32 %arg) { ret i32 0 }
8 define i64 @fun1(i64* %src, i64 %arg) { ret i64 0 }
9 define i32 @fun2(i32* %src, i32 %arg) { ret i32 0 }
10 define i64 @fun3(i64* %src, i64 %arg) { ret i64 0 }
15 # CHECK-LABEL: .LBB0_2:
16 # CHECK: msc %r0, 160(%r15) # 4-byte Folded Reload
20 tracksRegLiveness: true
22 - { id: 0, class: grx32bit }
23 - { id: 1, class: grx32bit }
24 - { id: 2, class: addr64bit }
25 - { id: 3, class: gr32bit }
26 - { id: 4, class: grx32bit }
27 - { id: 5, class: grx32bit }
28 - { id: 6, class: gr32bit }
29 - { id: 7, class: gr32bit }
30 - { id: 8, class: gr32bit }
32 - { reg: '$r2d', virtual-reg: '%2' }
33 - { reg: '$r3l', virtual-reg: '%3' }
36 hasOpaqueSPAdjustment: true
37 machineFunctionInfo: {}
40 successors: %bb.1(0x30000000), %bb.2(0x50000000)
43 %3:gr32bit = COPY $r3l
44 %2:addr64bit = COPY $r2d
46 CHIMux %3, 0, implicit-def $cc
48 BRC 14, 6, %bb.2, implicit killed $cc
52 %8:gr32bit = LMux %2, 0, $noreg :: (load (s32) from %ir.src)
53 INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def early-clobber $r15d
56 INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def early-clobber $r15d
57 %6:gr32bit = MSRKC %8, %6, implicit-def $cc
58 %6:gr32bit = LOCHIMux %6, 1, 14, 6, implicit killed $cc
59 %7:gr32bit = NRK %3, %6, implicit-def dead $cc
67 # CHECK-LABEL: .LBB1_2:
68 # CHECK: msc %r0, 160(%r15) # 4-byte Folded Reload
72 tracksRegLiveness: true
74 - { id: 0, class: grx32bit }
75 - { id: 1, class: grx32bit }
76 - { id: 2, class: addr64bit }
77 - { id: 3, class: gr32bit }
78 - { id: 4, class: grx32bit }
79 - { id: 5, class: grx32bit }
80 - { id: 6, class: gr32bit }
81 - { id: 7, class: gr32bit }
82 - { id: 8, class: gr32bit }
84 - { reg: '$r2d', virtual-reg: '%2' }
85 - { reg: '$r3l', virtual-reg: '%3' }
88 hasOpaqueSPAdjustment: true
89 machineFunctionInfo: {}
92 successors: %bb.1(0x30000000), %bb.2(0x50000000)
95 %3:gr32bit = COPY $r3l
96 %2:addr64bit = COPY $r2d
98 CHIMux %3, 0, implicit-def $cc
100 BRC 14, 6, %bb.2, implicit killed $cc
104 %8:gr32bit = LMux %2, 0, $noreg :: (load (s32) from %ir.src)
105 INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def early-clobber $r15d
108 INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def early-clobber $r15d
109 %6:gr32bit = MSRKC %6, %8, implicit-def $cc
110 %6:gr32bit = LOCHIMux %6, 1, 14, 6, implicit killed $cc
111 %7:gr32bit = NRK %3, %6, implicit-def dead $cc
119 # CHECK-LABEL: .LBB2_2:
120 # CHECK: msgc %r0, 160(%r15) # 8-byte Folded Reload
124 tracksRegLiveness: true
126 - { id: 0, class: gr64bit }
127 - { id: 1, class: gr64bit }
128 - { id: 2, class: addr64bit }
129 - { id: 3, class: gr64bit }
130 - { id: 4, class: gr64bit }
131 - { id: 5, class: gr64bit }
132 - { id: 6, class: gr64bit }
133 - { id: 7, class: gr64bit }
134 - { id: 8, class: gr64bit }
136 - { reg: '$r2d', virtual-reg: '%2' }
137 - { reg: '$r3d', virtual-reg: '%3' }
140 hasOpaqueSPAdjustment: true
141 machineFunctionInfo: {}
144 successors: %bb.1(0x30000000), %bb.2(0x50000000)
147 %3:gr64bit = COPY $r3d
148 %2:addr64bit = COPY $r2d
150 CGHI %3, 0, implicit-def $cc
152 BRC 14, 6, %bb.2, implicit killed $cc
156 %8:gr64bit = LG %2, 0, $noreg :: (load (s64) from %ir.src)
157 INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def early-clobber $r15d
160 INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def early-clobber $r15d
161 %6:gr64bit = MSGRKC %8, %6, implicit-def $cc
162 %6:gr64bit = LOCGHI %6, 1, 14, 6, implicit killed $cc
163 %7:gr64bit = NGRK %3, %6, implicit-def dead $cc
171 # CHECK-LABEL: .LBB3_2:
172 # CHECK: msgc %r0, 160(%r15) # 8-byte Folded Reload
176 tracksRegLiveness: true
178 - { id: 0, class: gr64bit }
179 - { id: 1, class: gr64bit }
180 - { id: 2, class: addr64bit }
181 - { id: 3, class: gr64bit }
182 - { id: 4, class: gr64bit }
183 - { id: 5, class: gr64bit }
184 - { id: 6, class: gr64bit }
185 - { id: 7, class: gr64bit }
186 - { id: 8, class: gr64bit }
188 - { reg: '$r2d', virtual-reg: '%2' }
189 - { reg: '$r3d', virtual-reg: '%3' }
192 hasOpaqueSPAdjustment: true
193 machineFunctionInfo: {}
196 successors: %bb.1(0x30000000), %bb.2(0x50000000)
199 %3:gr64bit = COPY $r3d
200 %2:addr64bit = COPY $r2d
202 CGHI %3, 0, implicit-def $cc
204 BRC 14, 6, %bb.2, implicit killed $cc
208 %8:gr64bit = LG %2, 0, $noreg :: (load (s64) from %ir.src)
209 INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def early-clobber $r15d
212 INLINEASM &"", 1, 12, implicit-def dead early-clobber $r0d, 12, implicit-def dead early-clobber $r1d, 12, implicit-def dead early-clobber $r2d, 12, implicit-def dead early-clobber $r3d, 12, implicit-def dead early-clobber $r4d, 12, implicit-def dead early-clobber $r5d, 12, implicit-def dead early-clobber $r6d, 12, implicit-def dead early-clobber $r7d, 12, implicit-def dead early-clobber $r8d, 12, implicit-def dead early-clobber $r9d, 12, implicit-def dead early-clobber $r10d, 12, implicit-def dead early-clobber $r11d, 12, implicit-def dead early-clobber $r12d, 12, implicit-def dead early-clobber $r13d, 12, implicit-def dead early-clobber $r14d, 12, implicit-def early-clobber $r15d
213 %6:gr64bit = MSGRKC %6, %8, implicit-def $cc
214 %6:gr64bit = LOCGHI %6, 1, 14, 6, implicit killed $cc
215 %7:gr64bit = NGRK %3, %6, implicit-def dead $cc