• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: llc -verify-machineinstrs -mcpu=pwr9 -mtriple powerpc64le-unknown-linux-gnu \
2# RUN:   -run-pass=block-placement -o - %s | FileCheck %s
3--- |
4  ; ModuleID = 'test.ll'
5  source_filename = "test.ll"
6  target datalayout = "e-m:e-i64:64-n32:64"
7
8  @_ZTIl = external constant i8*
9  @_ZTIi = external constant i8*
10  @_ZTIc = external constant i8*
11
12  define dso_local void @_Z6calleev() local_unnamed_addr {
13  entry:
14    tail call void @__cxa_rethrow()
15    unreachable
16  }
17
18  declare void @__cxa_rethrow() local_unnamed_addr
19
20  define dso_local void @_Z14TestSinglePredv() local_unnamed_addr personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
21  entry:
22    br label %for.body
23
24  for.cond.cleanup:                                 ; preds = %for.inc
25    ret void
26
27  for.body:                                         ; preds = %for.inc, %entry
28    %lsr.iv = phi i32 [ %lsr.iv.next, %for.inc ], [ 10, %entry ]
29    invoke void @__cxa_rethrow()
30            to label %.noexc unwind label %lpad
31
32  .noexc:                                           ; preds = %for.body
33    unreachable
34
35  lpad:                                             ; preds = %for.body
36    %0 = landingpad { i8*, i32 }
37            catch i8* bitcast (i8** @_ZTIl to i8*)
38            catch i8* bitcast (i8** @_ZTIi to i8*)
39            catch i8* null
40    %1 = extractvalue { i8*, i32 } %0, 0
41    %2 = extractvalue { i8*, i32 } %0, 1
42    %3 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIl to i8*))
43    %matches = icmp eq i32 %2, %3
44    br i1 %matches, label %catch4, label %catch.fallthrough
45
46  catch4:                                           ; preds = %lpad
47    %4 = tail call i8* @__cxa_begin_catch(i8* %1)
48    invoke void @__cxa_rethrow()
49            to label %unreachable unwind label %lpad6
50
51  catch.fallthrough:                                ; preds = %lpad
52    %5 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*))
53    %matches1 = icmp eq i32 %2, %5
54    %6 = tail call i8* @__cxa_begin_catch(i8* %1)
55    br i1 %matches1, label %catch2, label %catch
56
57  catch2:                                           ; preds = %catch.fallthrough
58    tail call void @__cxa_end_catch()
59    br label %for.inc
60
61  catch:                                            ; preds = %catch.fallthrough
62    tail call void @__cxa_end_catch()
63    br label %for.inc
64
65  lpad6:                                            ; preds = %catch4
66    %7 = landingpad { i8*, i32 }
67            cleanup
68            catch i8* bitcast (i8** @_ZTIc to i8*)
69    %8 = extractvalue { i8*, i32 } %7, 1
70    %9 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIc to i8*))
71    %matches9 = icmp eq i32 %8, %9
72    br i1 %matches9, label %catch10, label %ehcleanup
73
74  catch10:                                          ; preds = %lpad6
75    %10 = extractvalue { i8*, i32 } %7, 0
76    %11 = tail call i8* @__cxa_begin_catch(i8* %10)
77    tail call void @__cxa_end_catch()
78    tail call void @__cxa_end_catch()
79    br label %for.inc
80
81  for.inc:                                          ; preds = %catch10, %catch, %catch2
82    %lsr.iv.next = add nsw i32 %lsr.iv, -1
83    %exitcond = icmp eq i32 %lsr.iv.next, 0
84    br i1 %exitcond, label %for.cond.cleanup, label %for.body
85
86  ehcleanup:                                        ; preds = %lpad6
87    tail call void @__cxa_end_catch()
88    %exn.obj = extractvalue { i8*, i32 } %7, 0
89    call void @_Unwind_Resume(i8* %exn.obj)
90    unreachable
91
92  unreachable:                                      ; preds = %catch4
93    unreachable
94  }
95
96  declare i32 @__gxx_personality_v0(...)
97
98  ; Function Attrs: nounwind readnone
99  declare i32 @llvm.eh.typeid.for(i8*) #0
100
101  declare i8* @__cxa_begin_catch(i8*) local_unnamed_addr
102
103  declare void @__cxa_end_catch() local_unnamed_addr
104
105  ; Function Attrs: nounwind
106  declare void @llvm.stackprotector(i8*, i8**) #1
107
108  declare void @_Unwind_Resume(i8*)
109
110  attributes #0 = { nounwind readnone }
111  attributes #1 = { nounwind }
112
113...
114---
115name:            _Z6calleev
116alignment:       16
117exposesReturnsTwice: false
118legalized:       false
119regBankSelected: false
120selected:        false
121failedISel:      false
122tracksRegLiveness: true
123hasWinCFI:       false
124registers:       []
125liveins:         []
126frameInfo:
127  isFrameAddressTaken: false
128  isReturnAddressTaken: false
129  hasStackMap:     false
130  hasPatchPoint:   false
131  stackSize:       32
132  offsetAdjustment: 0
133  maxAlignment:    0
134  adjustsStack:    true
135  hasCalls:        true
136  stackProtector:  ''
137  maxCallFrameSize: 32
138  cvBytesOfCalleeSavedRegisters: 0
139  hasOpaqueSPAdjustment: false
140  hasVAStart:      false
141  hasMustTailInVarArgFunc: false
142  localFrameSize:  0
143  savePoint:       ''
144  restorePoint:    ''
145fixedStack:      []
146stack:           []
147callSites:       []
148constants:       []
149machineFunctionInfo: {}
150body:             |
151  bb.0.entry:
152    $x0 = MFLR8 implicit $lr8
153    STD killed $x0, 16, $x1
154    $x1 = STDU $x1, -32, $x1
155    CFI_INSTRUCTION def_cfa_offset 32
156    CFI_INSTRUCTION offset $lr8, 16
157    BL8_NOP @__cxa_rethrow, csr_ppc64_altivec, implicit-def dead $lr8, implicit $rm, implicit-def $r1
158
159...
160---
161name:            _Z14TestSinglePredv
162alignment:       16
163exposesReturnsTwice: false
164legalized:       false
165regBankSelected: false
166selected:        false
167failedISel:      false
168tracksRegLiveness: true
169hasWinCFI:       false
170registers:       []
171liveins:         []
172frameInfo:
173  isFrameAddressTaken: false
174  isReturnAddressTaken: false
175  hasStackMap:     false
176  hasPatchPoint:   false
177  stackSize:       64
178  offsetAdjustment: 0
179  maxAlignment:    0
180  adjustsStack:    true
181  hasCalls:        true
182  stackProtector:  ''
183  maxCallFrameSize: 32
184  cvBytesOfCalleeSavedRegisters: 0
185  hasOpaqueSPAdjustment: false
186  hasVAStart:      false
187  hasMustTailInVarArgFunc: false
188  localFrameSize:  0
189  savePoint:       ''
190  restorePoint:    ''
191fixedStack:
192  - { id: 0, type: spill-slot, offset: -80, size: 8, alignment: 16, stack-id: default,
193      callee-saved-register: '$x30', callee-saved-restored: true, debug-info-variable: '',
194      debug-info-expression: '', debug-info-location: '' }
195  - { id: 1, type: spill-slot, offset: -88, size: 8, alignment: 8, stack-id: default,
196      callee-saved-register: '$x29', callee-saved-restored: true, debug-info-variable: '',
197      debug-info-expression: '', debug-info-location: '' }
198stack:           []
199callSites:       []
200constants:       []
201machineFunctionInfo: {}
202body:             |
203  bb.0.entry:
204    successors: %bb.1(0x80000000)
205    liveins: $x29, $x30
206
207    $x0 = MFLR8 implicit $lr8
208    CFI_INSTRUCTION def_cfa_offset 64
209    CFI_INSTRUCTION offset $lr8, 16
210    CFI_INSTRUCTION offset $x29, -24
211    CFI_INSTRUCTION offset $x30, -16
212    STD killed $x29, -24, $x1 :: (store 8 into %fixed-stack.1)
213    STD killed $x30, -16, $x1 :: (store 8 into %fixed-stack.0, align 16)
214    STD killed $x0, 16, $x1
215    $x1 = STDU $x1, -64, $x1
216    renamable $r29 = LI 10
217
218  bb.1.for.body:
219    successors: %bb.2(0x7ffff800), %bb.3(0x00000800)
220    liveins: $r29
221
222    EH_LABEL <mcsymbol .Ltmp0>
223    BL8_NOP @__cxa_rethrow, csr_ppc64_altivec, implicit-def dead $lr8, implicit $rm, implicit-def $r1
224    EH_LABEL <mcsymbol .Ltmp1>
225
226  bb.2..noexc:
227    successors:
228
229
230  bb.3.lpad (landing-pad):
231    successors: %bb.4(0x00000001), %bb.5(0x7fffffff)
232    liveins: $r29, $x3, $x4
233
234    EH_LABEL <mcsymbol .Ltmp2>
235    $x30 = OR8 killed $x4, $x4
236    renamable $cr0 = CMPLWI renamable $r30, 3
237    BCC 71, killed renamable $cr0, %bb.5
238
239  bb.4.catch4:
240    successors: %bb.11(0x7ffff800), %bb.6(0x00000800)
241    liveins: $r29, $x3
242
243    BL8_NOP @__cxa_begin_catch, csr_ppc64_altivec, implicit-def dead $lr8, implicit $rm, implicit killed $x3, implicit $x2, implicit-def $r1, implicit-def dead $x3
244    EH_LABEL <mcsymbol .Ltmp3>
245    BL8_NOP @__cxa_rethrow, csr_ppc64_altivec, implicit-def dead $lr8, implicit $rm, implicit-def $r1
246    EH_LABEL <mcsymbol .Ltmp4>
247    B %bb.11
248
249  bb.5.catch.fallthrough:
250    successors: %bb.8(0x80000000)
251    liveins: $r29, $x3, $x30
252
253    BL8_NOP @__cxa_begin_catch, csr_ppc64_altivec, implicit-def dead $lr8, implicit $rm, implicit killed $x3, implicit $x2, implicit-def $r1, implicit-def dead $x3
254    renamable $cr0 = CMPLWI killed renamable $r30, 2, implicit $x30
255    B %bb.8
256
257  bb.6.lpad6 (landing-pad):
258    successors: %bb.7(0x7fffffff), %bb.10(0x00000001)
259    liveins: $r29, $x3, $x4
260
261    EH_LABEL <mcsymbol .Ltmp5>
262    renamable $cr0 = CMPLWI killed renamable $r4, 4, implicit $x4
263    $x30 = OR8 killed $x3, $x3
264    BCC 70, killed renamable $cr0, %bb.10
265
266  bb.7.catch10:
267    successors: %bb.8(0x80000000)
268    liveins: $r29, $x30
269
270    $x3 = OR8 killed $x30, $x30
271    BL8_NOP @__cxa_begin_catch, csr_ppc64_altivec, implicit-def dead $lr8, implicit $rm, implicit killed $x3, implicit-def $r1, implicit-def dead $x3
272    BL8_NOP @__cxa_end_catch, csr_ppc64_altivec, implicit-def dead $lr8, implicit $rm, implicit-def $r1
273
274  bb.8.for.inc:
275    successors: %bb.9(0x04000000), %bb.1(0x7c000000)
276    liveins: $r29
277
278    BL8_NOP @__cxa_end_catch, csr_ppc64_altivec, implicit-def dead $lr8, implicit $rm, implicit-def $r1
279    renamable $r29 = nsw ADDI killed renamable $r29, -1
280    renamable $cr0 = CMPLWI renamable $r29, 0
281    BCC 68, killed renamable $cr0, %bb.1
282
283  bb.9.for.cond.cleanup:
284    $x1 = ADDI8 $x1, 64
285    $x0 = LD 16, $x1
286    MTLR8 killed $x0, implicit-def $lr8
287    $x30 = LD -16, $x1 :: (load 8 from %fixed-stack.0, align 16)
288    $x29 = LD -24, $x1 :: (load 8 from %fixed-stack.1)
289    BLR8 implicit $lr8, implicit $rm
290
291  bb.10.ehcleanup:
292    successors:
293    liveins: $x30
294
295    BL8_NOP @__cxa_end_catch, csr_ppc64_altivec, implicit-def dead $lr8, implicit $rm, implicit-def $r1
296    $x3 = OR8 killed $x30, $x30
297    BL8_NOP @_Unwind_Resume, csr_ppc64_altivec, implicit-def dead $lr8, implicit $rm, implicit killed $x3, implicit-def $r1
298
299  bb.11.unreachable:
300
301  ; CHECK:      bb.1.for.body:
302  ; CHECK:        successors: %bb.2(0x7ffff800), %bb.3(0x00000800)
303  ; CHECK:        B %bb.2
304
305  ; CHECK:      bb.4.catch4:
306  ; CHECK:        successors: %bb.11(0x7ffff800), %bb.6(0x00000800)
307  ; CHECK:        B %bb.11
308
309  ; CHECK:      bb.2..noexc:
310
311  ; CHECK:      bb.11.unreachable:
312...
313