mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 13:11:39 +01:00
a124ec224e
To make this work, pointers from the MachineBasicBlock to the LLVM-IR-level basic blocks need to be initialized, as the AsmPrinter uses this link to be able to print out labels for the basic blocks that are address-taken. Most of the changes in this commit are about adapting existing tests to include the basic block name that is now printed out in the MIR format, now that the name becomes available as the link to the LLVM-IR basic block is initialized. The relevant test change for the functionality added in this patch are the added "(address-taken)" strings in test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll. Differential Revision: https://reviews.llvm.org/D28123 llvm-svn: 291105
45 lines
1.6 KiB
LLVM
45 lines
1.6 KiB
LLVM
; RUN: llc -O0 -mtriple=aarch64-apple-ios -global-isel -stop-after=irtranslator %s -o - | FileCheck %s
|
|
|
|
@_ZTIi = external global i8*
|
|
|
|
declare i32 @foo(i32)
|
|
declare i32 @__gxx_personality_v0(...)
|
|
declare i32 @llvm.eh.typeid.for(i8*)
|
|
|
|
; CHECK: name: bar
|
|
; CHECK: body:
|
|
; CHECK-NEXT: bb.1 (%ir-block.0):
|
|
; CHECK: successors: %[[GOOD:bb.[0-9]+.continue]]{{.*}}%[[BAD:bb.[0-9]+.broken]]
|
|
; CHECK: EH_LABEL
|
|
; CHECK: %w0 = COPY
|
|
; CHECK: BL @foo, csr_aarch64_aapcs, implicit-def %lr, implicit %sp, implicit %w0, implicit-def %w0
|
|
; CHECK: {{%[0-9]+}}(s32) = COPY %w0
|
|
; CHECK: EH_LABEL
|
|
|
|
; CHECK: [[BAD]] (landing-pad):
|
|
; CHECK: EH_LABEL
|
|
; CHECK: [[PTR:%[0-9]+]](p0) = COPY %x0
|
|
; CHECK: [[SEL:%[0-9]+]](p0) = COPY %x1
|
|
; CHECK: [[PTR_SEL:%[0-9]+]](s128) = G_SEQUENCE [[PTR]](p0), 0, [[SEL]](p0), 64
|
|
; CHECK: [[PTR_RET:%[0-9]+]](s64), [[SEL_RET:%[0-9]+]](s32) = G_EXTRACT [[PTR_SEL]](s128), 0, 64
|
|
; CHECK: %x0 = COPY [[PTR_RET]]
|
|
; CHECK: %w1 = COPY [[SEL_RET]]
|
|
|
|
; CHECK: [[GOOD]]:
|
|
; CHECK: [[SEL:%[0-9]+]](s32) = G_CONSTANT i32 1
|
|
; CHECK: {{%[0-9]+}}(s128) = G_INSERT {{%[0-9]+}}(s128), [[SEL]](s32), 64
|
|
|
|
define { i8*, i32 } @bar() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
|
|
%res32 = invoke i32 @foo(i32 42) to label %continue unwind label %broken
|
|
|
|
|
|
broken:
|
|
%ptr.sel = landingpad { i8*, i32 } catch i8* bitcast(i8** @_ZTIi to i8*)
|
|
ret { i8*, i32 } %ptr.sel
|
|
|
|
continue:
|
|
%sel.int = tail call i32 @llvm.eh.typeid.for(i8* bitcast(i8** @_ZTIi to i8*))
|
|
%res.good = insertvalue { i8*, i32 } undef, i32 %sel.int, 1
|
|
ret { i8*, i32 } %res.good
|
|
}
|