| 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 ptr |
| 9 |
@_ZTIi = external constant ptr |
| 10 |
@_ZTIc = external constant ptr |
| 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 ptr @__gxx_personality_v0 { |
| 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 { ptr, i32 } |
| 37 |
catch ptr @_ZTIl |
| 38 |
catch ptr @_ZTIi |
| 39 |
catch ptr null |
| 40 |
%1 = extractvalue { ptr, i32 } %0, 0 |
| 41 |
%2 = extractvalue { ptr, i32 } %0, 1 |
| 42 |
%3 = tail call i32 @llvm.eh.typeid.for(ptr @_ZTIl) |
| 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 ptr @__cxa_begin_catch(ptr %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(ptr @_ZTIi) |
| 53 |
%matches1 = icmp eq i32 %2, %5 |
| 54 |
%6 = tail call ptr @__cxa_begin_catch(ptr %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 { ptr, i32 } |
| 67 |
cleanup |
| 68 |
catch ptr @_ZTIc |
| 69 |
%8 = extractvalue { ptr, i32 } %7, 1 |
| 70 |
%9 = tail call i32 @llvm.eh.typeid.for(ptr @_ZTIc) |
| 71 |
%matches9 = icmp eq i32 %8, %9 |
| 72 |
br i1 %matches9, label %catch10, label %ehcleanup |
| 73 |
|
| 74 |
catch10: ; preds = %lpad6 |
| 75 |
%10 = extractvalue { ptr, i32 } %7, 0 |
| 76 |
%11 = tail call ptr @__cxa_begin_catch(ptr %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 { ptr, i32 } %7, 0 |
| 89 |
call void @_Unwind_Resume(ptr %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(ptr) #0 |
| 100 |
|
| 101 |
declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr |
| 102 |
|
| 103 |
declare void @__cxa_end_catch() local_unnamed_addr |
| 104 |
|
| 105 |
; Function Attrs: nounwind |
| 106 |
declare void @llvm.stackprotector(ptr, ptr) #1 |
| 107 |
|
| 108 |
declare void @_Unwind_Resume(ptr) |
| 109 |
|
| 110 |
attributes #0 = { nounwind readnone } |
| 111 |
attributes #1 = { nounwind } |
| 112 |
|
| 113 |
... |
| 114 |
--- |
| 115 |
name: _Z6calleev |
| 116 |
alignment: 16 |
| 117 |
exposesReturnsTwice: false |
| 118 |
legalized: false |
| 119 |
regBankSelected: false |
| 120 |
selected: false |
| 121 |
failedISel: false |
| 122 |
tracksRegLiveness: true |
| 123 |
hasWinCFI: false |
| 124 |
registers: [] |
| 125 |
liveins: [] |
| 126 |
frameInfo: |
| 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: [] |
| 145 |
fixedStack: [] |
| 146 |
stack: [] |
| 147 |
callSites: [] |
| 148 |
constants: [] |
| 149 |
machineFunctionInfo: {} |
| 150 |
body: | |
| 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 |
--- |
| 161 |
name: _Z14TestSinglePredv |
| 162 |
alignment: 16 |
| 163 |
exposesReturnsTwice: false |
| 164 |
legalized: false |
| 165 |
regBankSelected: false |
| 166 |
selected: false |
| 167 |
failedISel: false |
| 168 |
tracksRegLiveness: true |
| 169 |
hasWinCFI: false |
| 170 |
registers: [] |
| 171 |
liveins: [] |
| 172 |
frameInfo: |
| 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: [] |
| 191 |
fixedStack: |
| 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: '' } |
| 198 |
stack: [] |
| 199 |
callSites: [] |
| 200 |
constants: [] |
| 201 |
machineFunctionInfo: {} |
| 202 |
body: | |
| 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 (s64) into %fixed-stack.1) |
| 213 |
STD killed $x30, -16, $x1 :: (store (s64) 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 (s64) from %fixed-stack.0, align 16) |
| 288 |
$x29 = LD -24, $x1 :: (load (s64) 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 |
... |