[AArch64][GISel] Update and regenerate arm64-this-return.ll (#191515)
This updates the arm64-this-return.ll test, splitting the GISel
update_mir_test_checks into a separate GlobalISel test file.
diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/arm64-this-return.ll b/llvm/test/CodeGen/AArch64/GlobalISel/arm64-this-return.ll
new file mode 100644
index 0000000..00abaeb
--- /dev/null
+++ b/llvm/test/CodeGen/AArch64/GlobalISel/arm64-this-return.ll
@@ -0,0 +1,150 @@
+; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
+; RUN: llc < %s -mtriple=arm64-eabi -global-isel -stop-after=irtranslator | FileCheck %s
+
+%struct.A = type { i8 }
+%struct.B = type { i32 }
+%struct.C = type { %struct.B }
+%struct.D = type { %struct.B }
+%struct.E = type { %struct.B, %struct.B }
+
+declare ptr @A_ctor_base(ptr returned)
+declare ptr @B_ctor_base(ptr returned, i32)
+declare ptr @B_ctor_complete(ptr returned, i32)
+
+declare ptr @A_ctor_base_nothisret(ptr)
+declare ptr @B_ctor_base_nothisret(ptr, i32)
+declare ptr @B_ctor_complete_nothisret(ptr, i32)
+
+define ptr @C_ctor_base(ptr returned %this, i32 %x) {
+ ; CHECK-LABEL: name: C_ctor_base
+ ; CHECK: bb.1.entry:
+ ; CHECK-NEXT: liveins: $w1, $x0
+ ; CHECK-NEXT: {{ $}}
+ ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
+ ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
+ ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
+ ; CHECK-NEXT: $x0 = COPY [[COPY]](p0)
+ ; CHECK-NEXT: BL @A_ctor_base, csr_aarch64_aapcs_thisreturn, implicit-def $lr, implicit $sp, implicit $x0
+ ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
+ ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(p0) = COPY [[COPY]](p0)
+ ; CHECK-NEXT: $x0 = COPY [[COPY]](p0)
+ ; CHECK-NEXT: $w1 = COPY [[COPY1]](s32)
+ ; CHECK-NEXT: TCRETURNdi @B_ctor_base, 0, csr_aarch64_aapcs, implicit $sp, implicit $x0, implicit $w1
+entry:
+ %call = tail call ptr @A_ctor_base(ptr returned %this)
+ %call2 = tail call ptr @B_ctor_base(ptr returned %this, i32 %x)
+ ret ptr %this
+}
+
+define ptr @C_ctor_base_nothisret(ptr %this, i32 %x) {
+ ; CHECK-LABEL: name: C_ctor_base_nothisret
+ ; CHECK: bb.1.entry:
+ ; CHECK-NEXT: liveins: $w1, $x0
+ ; CHECK-NEXT: {{ $}}
+ ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
+ ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
+ ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
+ ; CHECK-NEXT: $x0 = COPY [[COPY]](p0)
+ ; CHECK-NEXT: BL @A_ctor_base_nothisret, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0, implicit-def $x0
+ ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
+ ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(p0) = COPY $x0
+ ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
+ ; CHECK-NEXT: $x0 = COPY [[COPY]](p0)
+ ; CHECK-NEXT: $w1 = COPY [[COPY1]](s32)
+ ; CHECK-NEXT: BL @B_ctor_base_nothisret, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0, implicit $w1, implicit-def $x0
+ ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
+ ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(p0) = COPY $x0
+ ; CHECK-NEXT: $x0 = COPY [[COPY]](p0)
+ ; CHECK-NEXT: RET_ReallyLR implicit $x0
+entry:
+ %call = tail call ptr @A_ctor_base_nothisret(ptr %this)
+ %call2 = tail call ptr @B_ctor_base_nothisret(ptr %this, i32 %x)
+ ret ptr %this
+}
+
+define ptr @C_ctor_complete(ptr %this, i32 %x) {
+ ; CHECK-LABEL: name: C_ctor_complete
+ ; CHECK: bb.1.entry:
+ ; CHECK-NEXT: liveins: $w1, $x0
+ ; CHECK-NEXT: {{ $}}
+ ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
+ ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
+ ; CHECK-NEXT: $x0 = COPY [[COPY]](p0)
+ ; CHECK-NEXT: $w1 = COPY [[COPY1]](s32)
+ ; CHECK-NEXT: TCRETURNdi @C_ctor_base, 0, csr_aarch64_aapcs, implicit $sp, implicit $x0, implicit $w1
+entry:
+ %call = tail call ptr @C_ctor_base(ptr returned %this, i32 %x)
+ ret ptr %this
+}
+
+define ptr @C_ctor_complete_nothisret(ptr %this, i32 %x) {
+ ; CHECK-LABEL: name: C_ctor_complete_nothisret
+ ; CHECK: bb.1.entry:
+ ; CHECK-NEXT: liveins: $w1, $x0
+ ; CHECK-NEXT: {{ $}}
+ ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
+ ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
+ ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
+ ; CHECK-NEXT: $x0 = COPY [[COPY]](p0)
+ ; CHECK-NEXT: $w1 = COPY [[COPY1]](s32)
+ ; CHECK-NEXT: BL @C_ctor_base_nothisret, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0, implicit $w1, implicit-def $x0
+ ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
+ ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(p0) = COPY $x0
+ ; CHECK-NEXT: $x0 = COPY [[COPY]](p0)
+ ; CHECK-NEXT: RET_ReallyLR implicit $x0
+entry:
+ %call = tail call ptr @C_ctor_base_nothisret(ptr %this, i32 %x)
+ ret ptr %this
+}
+
+define ptr @D_ctor_base(ptr %this, i32 %x) {
+ ; CHECK-LABEL: name: D_ctor_base
+ ; CHECK: bb.1.entry:
+ ; CHECK-NEXT: liveins: $w1, $x0
+ ; CHECK-NEXT: {{ $}}
+ ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
+ ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
+ ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
+ ; CHECK-NEXT: $x0 = COPY [[COPY]](p0)
+ ; CHECK-NEXT: $w1 = COPY [[COPY1]](s32)
+ ; CHECK-NEXT: BL @B_ctor_complete, csr_aarch64_aapcs_thisreturn, implicit-def $lr, implicit $sp, implicit $x0, implicit $w1
+ ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
+ ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(p0) = COPY [[COPY]](p0)
+ ; CHECK-NEXT: $x0 = COPY [[COPY]](p0)
+ ; CHECK-NEXT: $w1 = COPY [[COPY1]](s32)
+ ; CHECK-NEXT: TCRETURNdi @B_ctor_complete, 0, csr_aarch64_aapcs, implicit $sp, implicit $x0, implicit $w1
+entry:
+ %call = tail call ptr @B_ctor_complete(ptr returned %this, i32 %x)
+ %call2 = tail call ptr @B_ctor_complete(ptr returned %this, i32 %x)
+ ret ptr %this
+}
+
+define ptr @E_ctor_base(ptr %this, i32 %x) {
+ ; CHECK-LABEL: name: E_ctor_base
+ ; CHECK: bb.1.entry:
+ ; CHECK-NEXT: liveins: $w1, $x0
+ ; CHECK-NEXT: {{ $}}
+ ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
+ ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
+ ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
+ ; CHECK-NEXT: $x0 = COPY [[COPY]](p0)
+ ; CHECK-NEXT: $w1 = COPY [[COPY1]](s32)
+ ; CHECK-NEXT: BL @B_ctor_complete, csr_aarch64_aapcs_thisreturn, implicit-def $lr, implicit $sp, implicit $x0, implicit $w1
+ ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
+ ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(p0) = COPY [[COPY]](p0)
+ ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 4
+ ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = nuw nusw inbounds G_PTR_ADD [[COPY]], [[C]](s64)
+ ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
+ ; CHECK-NEXT: $x0 = COPY [[PTR_ADD]](p0)
+ ; CHECK-NEXT: $w1 = COPY [[COPY1]](s32)
+ ; CHECK-NEXT: BL @B_ctor_complete, csr_aarch64_aapcs_thisreturn, implicit-def $lr, implicit $sp, implicit $x0, implicit $w1
+ ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
+ ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(p0) = COPY [[PTR_ADD]](p0)
+ ; CHECK-NEXT: $x0 = COPY [[COPY]](p0)
+ ; CHECK-NEXT: RET_ReallyLR implicit $x0
+entry:
+ %call = tail call ptr @B_ctor_complete(ptr returned %this, i32 %x)
+ %b2 = getelementptr inbounds %struct.E, ptr %this, i32 0, i32 1
+ %call2 = tail call ptr @B_ctor_complete(ptr returned %b2, i32 %x)
+ ret ptr %this
+}
diff --git a/llvm/test/CodeGen/AArch64/arm64-this-return.ll b/llvm/test/CodeGen/AArch64/arm64-this-return.ll
index 7dd47ac..7ca7f6d 100644
--- a/llvm/test/CodeGen/AArch64/arm64-this-return.ll
+++ b/llvm/test/CodeGen/AArch64/arm64-this-return.ll
@@ -1,7 +1,6 @@
-; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
-; RUN: llc < %s -mtriple=arm64-eabi | FileCheck %s
-; RUN: llc < %s -mtriple=arm64-eabi -global-isel -global-isel-abort=1 | FileCheck %s
-; RUN: llc < %s -mtriple=arm64-eabi -global-isel -global-isel-abort=1 -stop-after=irtranslator | FileCheck %s --check-prefix=GISEL-MIR
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=arm64-eabi | FileCheck %s --check-prefixes=CHECK,CHECK-SD
+; RUN: llc < %s -mtriple=arm64-eabi -global-isel | FileCheck %s --check-prefixes=CHECK,CHECK-GI
%struct.A = type { i8 }
%struct.B = type { i32 }
@@ -18,148 +17,150 @@
declare ptr @B_ctor_complete_nothisret(ptr, i32)
define ptr @C_ctor_base(ptr returned %this, i32 %x) {
- ; GISEL-MIR-LABEL: name: C_ctor_base
- ; GISEL-MIR: bb.1.entry:
- ; GISEL-MIR: liveins: $w1, $x0
- ; GISEL-MIR: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
- ; GISEL-MIR: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
- ; GISEL-MIR: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
- ; GISEL-MIR: $x0 = COPY [[COPY]](p0)
- ; GISEL-MIR: BL @A_ctor_base, csr_aarch64_aapcs_thisreturn, implicit-def $lr, implicit $sp, implicit $x0
- ; GISEL-MIR: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
- ; GISEL-MIR: [[COPY2:%[0-9]+]]:_(p0) = COPY [[COPY]](p0)
- ; GISEL-MIR: $x0 = COPY [[COPY]](p0)
- ; GISEL-MIR: $w1 = COPY [[COPY1]](s32)
- ; GISEL-MIR: TCRETURNdi @B_ctor_base, 0, csr_aarch64_aapcs, implicit $sp, implicit $x0, implicit $w1
-entry:
; CHECK-LABEL: C_ctor_base:
-; CHECK-NOT: mov {{x[0-9]+}}, x0
-; CHECK: bl {{_?A_ctor_base}}
-; CHECK-NOT: mov x0, {{x[0-9]+}}
-; CHECK: b {{_?B_ctor_base}}
+; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: stp x30, x19, [sp, #-16]! // 16-byte Folded Spill
+; CHECK-NEXT: .cfi_def_cfa_offset 16
+; CHECK-NEXT: .cfi_offset w19, -8
+; CHECK-NEXT: .cfi_offset w30, -16
+; CHECK-NEXT: mov w19, w1
+; CHECK-NEXT: bl A_ctor_base
+; CHECK-NEXT: mov w1, w19
+; CHECK-NEXT: ldp x30, x19, [sp], #16 // 16-byte Folded Reload
+; CHECK-NEXT: b B_ctor_base
+entry:
%call = tail call ptr @A_ctor_base(ptr returned %this)
%call2 = tail call ptr @B_ctor_base(ptr returned %this, i32 %x)
ret ptr %this
}
define ptr @C_ctor_base_nothisret(ptr %this, i32 %x) {
- ; GISEL-MIR-LABEL: name: C_ctor_base_nothisret
- ; GISEL-MIR: bb.1.entry:
- ; GISEL-MIR: liveins: $w1, $x0
- ; GISEL-MIR: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
- ; GISEL-MIR: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
- ; GISEL-MIR: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
- ; GISEL-MIR: $x0 = COPY [[COPY]](p0)
- ; GISEL-MIR: BL @A_ctor_base_nothisret, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0, implicit-def $x0
- ; GISEL-MIR: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
- ; GISEL-MIR: [[COPY2:%[0-9]+]]:_(p0) = COPY $x0
- ; GISEL-MIR: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
- ; GISEL-MIR: $x0 = COPY [[COPY]](p0)
- ; GISEL-MIR: $w1 = COPY [[COPY1]](s32)
- ; GISEL-MIR: BL @B_ctor_base_nothisret, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0, implicit $w1, implicit-def $x0
- ; GISEL-MIR: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
- ; GISEL-MIR: [[COPY3:%[0-9]+]]:_(p0) = COPY $x0
- ; GISEL-MIR: $x0 = COPY [[COPY]](p0)
- ; GISEL-MIR: RET_ReallyLR implicit $x0
+; CHECK-SD-LABEL: C_ctor_base_nothisret:
+; CHECK-SD: // %bb.0: // %entry
+; CHECK-SD-NEXT: str x30, [sp, #-32]! // 8-byte Folded Spill
+; CHECK-SD-NEXT: stp x20, x19, [sp, #16] // 16-byte Folded Spill
+; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
+; CHECK-SD-NEXT: .cfi_offset w19, -8
+; CHECK-SD-NEXT: .cfi_offset w20, -16
+; CHECK-SD-NEXT: .cfi_offset w30, -32
+; CHECK-SD-NEXT: mov w19, w1
+; CHECK-SD-NEXT: mov x20, x0
+; CHECK-SD-NEXT: bl A_ctor_base_nothisret
+; CHECK-SD-NEXT: mov x0, x20
+; CHECK-SD-NEXT: mov w1, w19
+; CHECK-SD-NEXT: bl B_ctor_base_nothisret
+; CHECK-SD-NEXT: mov x0, x20
+; CHECK-SD-NEXT: ldp x20, x19, [sp, #16] // 16-byte Folded Reload
+; CHECK-SD-NEXT: ldr x30, [sp], #32 // 8-byte Folded Reload
+; CHECK-SD-NEXT: ret
+;
+; CHECK-GI-LABEL: C_ctor_base_nothisret:
+; CHECK-GI: // %bb.0: // %entry
+; CHECK-GI-NEXT: str x30, [sp, #-32]! // 8-byte Folded Spill
+; CHECK-GI-NEXT: stp x20, x19, [sp, #16] // 16-byte Folded Spill
+; CHECK-GI-NEXT: .cfi_def_cfa_offset 32
+; CHECK-GI-NEXT: .cfi_offset w19, -8
+; CHECK-GI-NEXT: .cfi_offset w20, -16
+; CHECK-GI-NEXT: .cfi_offset w30, -32
+; CHECK-GI-NEXT: mov x19, x0
+; CHECK-GI-NEXT: mov w20, w1
+; CHECK-GI-NEXT: bl A_ctor_base_nothisret
+; CHECK-GI-NEXT: mov x0, x19
+; CHECK-GI-NEXT: mov w1, w20
+; CHECK-GI-NEXT: bl B_ctor_base_nothisret
+; CHECK-GI-NEXT: mov x0, x19
+; CHECK-GI-NEXT: ldp x20, x19, [sp, #16] // 16-byte Folded Reload
+; CHECK-GI-NEXT: ldr x30, [sp], #32 // 8-byte Folded Reload
+; CHECK-GI-NEXT: ret
entry:
-; CHECK-LABEL: C_ctor_base_nothisret:
-; CHECK: mov [[SAVETHIS:x[0-9]+]], x0
-; CHECK: bl {{_?A_ctor_base_nothisret}}
-; CHECK: mov x0, [[SAVETHIS]]
-; CHECK-NOT: b {{_?B_ctor_base_nothisret}}
%call = tail call ptr @A_ctor_base_nothisret(ptr %this)
%call2 = tail call ptr @B_ctor_base_nothisret(ptr %this, i32 %x)
ret ptr %this
}
define ptr @C_ctor_complete(ptr %this, i32 %x) {
- ; GISEL-MIR-LABEL: name: C_ctor_complete
- ; GISEL-MIR: bb.1.entry:
- ; GISEL-MIR: liveins: $w1, $x0
- ; GISEL-MIR: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
- ; GISEL-MIR: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
- ; GISEL-MIR: $x0 = COPY [[COPY]](p0)
- ; GISEL-MIR: $w1 = COPY [[COPY1]](s32)
- ; GISEL-MIR: TCRETURNdi @C_ctor_base, 0, csr_aarch64_aapcs, implicit $sp, implicit $x0, implicit $w1
-entry:
; CHECK-LABEL: C_ctor_complete:
-; CHECK: b {{_?C_ctor_base}}
+; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: b C_ctor_base
+entry:
%call = tail call ptr @C_ctor_base(ptr returned %this, i32 %x)
ret ptr %this
}
define ptr @C_ctor_complete_nothisret(ptr %this, i32 %x) {
- ; GISEL-MIR-LABEL: name: C_ctor_complete_nothisret
- ; GISEL-MIR: bb.1.entry:
- ; GISEL-MIR: liveins: $w1, $x0
- ; GISEL-MIR: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
- ; GISEL-MIR: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
- ; GISEL-MIR: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
- ; GISEL-MIR: $x0 = COPY [[COPY]](p0)
- ; GISEL-MIR: $w1 = COPY [[COPY1]](s32)
- ; GISEL-MIR: BL @C_ctor_base_nothisret, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0, implicit $w1, implicit-def $x0
- ; GISEL-MIR: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
- ; GISEL-MIR: [[COPY2:%[0-9]+]]:_(p0) = COPY $x0
- ; GISEL-MIR: $x0 = COPY [[COPY]](p0)
- ; GISEL-MIR: RET_ReallyLR implicit $x0
-entry:
; CHECK-LABEL: C_ctor_complete_nothisret:
-; CHECK-NOT: b {{_?C_ctor_base_nothisret}}
+; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: stp x30, x19, [sp, #-16]! // 16-byte Folded Spill
+; CHECK-NEXT: .cfi_def_cfa_offset 16
+; CHECK-NEXT: .cfi_offset w19, -8
+; CHECK-NEXT: .cfi_offset w30, -16
+; CHECK-NEXT: mov x19, x0
+; CHECK-NEXT: bl C_ctor_base_nothisret
+; CHECK-NEXT: mov x0, x19
+; CHECK-NEXT: ldp x30, x19, [sp], #16 // 16-byte Folded Reload
+; CHECK-NEXT: ret
+entry:
%call = tail call ptr @C_ctor_base_nothisret(ptr %this, i32 %x)
ret ptr %this
}
define ptr @D_ctor_base(ptr %this, i32 %x) {
- ; GISEL-MIR-LABEL: name: D_ctor_base
- ; GISEL-MIR: bb.1.entry:
- ; GISEL-MIR: liveins: $w1, $x0
- ; GISEL-MIR: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
- ; GISEL-MIR: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
- ; GISEL-MIR: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
- ; GISEL-MIR: $x0 = COPY [[COPY]](p0)
- ; GISEL-MIR: $w1 = COPY [[COPY1]](s32)
- ; GISEL-MIR: BL @B_ctor_complete, csr_aarch64_aapcs_thisreturn, implicit-def $lr, implicit $sp, implicit $x0, implicit $w1
- ; GISEL-MIR: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
- ; GISEL-MIR: [[COPY2:%[0-9]+]]:_(p0) = COPY [[COPY]](p0)
- ; GISEL-MIR: $x0 = COPY [[COPY]](p0)
- ; GISEL-MIR: $w1 = COPY [[COPY1]](s32)
- ; GISEL-MIR: TCRETURNdi @B_ctor_complete, 0, csr_aarch64_aapcs, implicit $sp, implicit $x0, implicit $w1
-entry:
; CHECK-LABEL: D_ctor_base:
-; CHECK-NOT: mov {{x[0-9]+}}, x0
-; CHECK: bl {{_?B_ctor_complete}}
-; CHECK-NOT: mov x0, {{x[0-9]+}}
-; CHECK: b {{_?B_ctor_complete}}
+; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: stp x30, x19, [sp, #-16]! // 16-byte Folded Spill
+; CHECK-NEXT: .cfi_def_cfa_offset 16
+; CHECK-NEXT: .cfi_offset w19, -8
+; CHECK-NEXT: .cfi_offset w30, -16
+; CHECK-NEXT: mov w19, w1
+; CHECK-NEXT: bl B_ctor_complete
+; CHECK-NEXT: mov w1, w19
+; CHECK-NEXT: ldp x30, x19, [sp], #16 // 16-byte Folded Reload
+; CHECK-NEXT: b B_ctor_complete
+entry:
%call = tail call ptr @B_ctor_complete(ptr returned %this, i32 %x)
%call2 = tail call ptr @B_ctor_complete(ptr returned %this, i32 %x)
ret ptr %this
}
define ptr @E_ctor_base(ptr %this, i32 %x) {
- ; GISEL-MIR-LABEL: name: E_ctor_base
- ; GISEL-MIR: bb.1.entry:
- ; GISEL-MIR: liveins: $w1, $x0
- ; GISEL-MIR: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
- ; GISEL-MIR: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
- ; GISEL-MIR: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
- ; GISEL-MIR: $x0 = COPY [[COPY]](p0)
- ; GISEL-MIR: $w1 = COPY [[COPY1]](s32)
- ; GISEL-MIR: BL @B_ctor_complete, csr_aarch64_aapcs_thisreturn, implicit-def $lr, implicit $sp, implicit $x0, implicit $w1
- ; GISEL-MIR: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
- ; GISEL-MIR: [[COPY2:%[0-9]+]]:_(p0) = COPY [[COPY]](p0)
- ; GISEL-MIR: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 4
- ; GISEL-MIR: [[PTR_ADD:%[0-9]+]]:_(p0) = nuw nusw inbounds G_PTR_ADD [[COPY]], [[C]](s64)
- ; GISEL-MIR: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
- ; GISEL-MIR: $x0 = COPY [[PTR_ADD]](p0)
- ; GISEL-MIR: $w1 = COPY [[COPY1]](s32)
- ; GISEL-MIR: BL @B_ctor_complete, csr_aarch64_aapcs_thisreturn, implicit-def $lr, implicit $sp, implicit $x0, implicit $w1
- ; GISEL-MIR: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
- ; GISEL-MIR: [[COPY3:%[0-9]+]]:_(p0) = COPY [[PTR_ADD]](p0)
- ; GISEL-MIR: $x0 = COPY [[COPY]](p0)
- ; GISEL-MIR: RET_ReallyLR implicit $x0
+; CHECK-SD-LABEL: E_ctor_base:
+; CHECK-SD: // %bb.0: // %entry
+; CHECK-SD-NEXT: str x30, [sp, #-32]! // 8-byte Folded Spill
+; CHECK-SD-NEXT: stp x20, x19, [sp, #16] // 16-byte Folded Spill
+; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
+; CHECK-SD-NEXT: .cfi_offset w19, -8
+; CHECK-SD-NEXT: .cfi_offset w20, -16
+; CHECK-SD-NEXT: .cfi_offset w30, -32
+; CHECK-SD-NEXT: mov w19, w1
+; CHECK-SD-NEXT: mov x20, x0
+; CHECK-SD-NEXT: bl B_ctor_complete
+; CHECK-SD-NEXT: add x0, x0, #4
+; CHECK-SD-NEXT: mov w1, w19
+; CHECK-SD-NEXT: bl B_ctor_complete
+; CHECK-SD-NEXT: mov x0, x20
+; CHECK-SD-NEXT: ldp x20, x19, [sp, #16] // 16-byte Folded Reload
+; CHECK-SD-NEXT: ldr x30, [sp], #32 // 8-byte Folded Reload
+; CHECK-SD-NEXT: ret
+;
+; CHECK-GI-LABEL: E_ctor_base:
+; CHECK-GI: // %bb.0: // %entry
+; CHECK-GI-NEXT: str x30, [sp, #-32]! // 8-byte Folded Spill
+; CHECK-GI-NEXT: stp x20, x19, [sp, #16] // 16-byte Folded Spill
+; CHECK-GI-NEXT: .cfi_def_cfa_offset 32
+; CHECK-GI-NEXT: .cfi_offset w19, -8
+; CHECK-GI-NEXT: .cfi_offset w20, -16
+; CHECK-GI-NEXT: .cfi_offset w30, -32
+; CHECK-GI-NEXT: mov x19, x0
+; CHECK-GI-NEXT: mov w20, w1
+; CHECK-GI-NEXT: bl B_ctor_complete
+; CHECK-GI-NEXT: add x0, x0, #4
+; CHECK-GI-NEXT: mov w1, w20
+; CHECK-GI-NEXT: bl B_ctor_complete
+; CHECK-GI-NEXT: mov x0, x19
+; CHECK-GI-NEXT: ldp x20, x19, [sp, #16] // 16-byte Folded Reload
+; CHECK-GI-NEXT: ldr x30, [sp], #32 // 8-byte Folded Reload
+; CHECK-GI-NEXT: ret
entry:
-; CHECK-LABEL: E_ctor_base:
-; CHECK-NOT: b {{_?B_ctor_complete}}
%call = tail call ptr @B_ctor_complete(ptr returned %this, i32 %x)
%b2 = getelementptr inbounds %struct.E, ptr %this, i32 0, i32 1
%call2 = tail call ptr @B_ctor_complete(ptr returned %b2, i32 %x)