1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc < %s | FileCheck %s
4 ; Test case to demonstrate a bug where calls to OUTLINED_FUNCTION_1 are
5 ; inserted at a point where LR is live.
7 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
8 target triple = "aarch64-arm-none-eabi"
10 define hidden void @_ZTv0_n24_N2C6D1Ev(ptr %this) minsize sspreq "target-features"="+harden-sls-retbr" {
11 ; CHECK-LABEL: _ZTv0_n24_N2C6D1Ev:
12 ; CHECK: // %bb.0: // %entry
13 ; CHECK-NEXT: sub sp, sp, #32
14 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
15 ; CHECK-NEXT: .cfi_def_cfa_offset 32
16 ; CHECK-NEXT: .cfi_offset w30, -16
17 ; CHECK-NEXT: bl OUTLINED_FUNCTION_0
18 ; CHECK-NEXT: b.ne .LBB0_2
19 ; CHECK-NEXT: // %bb.1: // %entry
20 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
21 ; CHECK-NEXT: bl OUTLINED_FUNCTION_1
22 ; CHECK-NEXT: b _ZN2C6D1Ev
25 ; CHECK-NEXT: .LBB0_2: // %entry
26 ; CHECK-NEXT: bl __stack_chk_fail
28 %0 = load ptr, ptr %this, align 8
29 %1 = getelementptr inbounds i8, ptr %0, i64 -24
30 %2 = load i64, ptr %1, align 8
31 %3 = getelementptr inbounds i8, ptr %this, i64 %2
32 tail call void @_ZN2C6D1Ev(ptr %3)
37 define hidden void @_ZTv0_n24_N2C6D0Ev(ptr %this) minsize sspreq "target-features"="+harden-sls-retbr" {
38 ; CHECK-LABEL: _ZTv0_n24_N2C6D0Ev:
39 ; CHECK: // %bb.0: // %entry
40 ; CHECK-NEXT: sub sp, sp, #32
41 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
42 ; CHECK-NEXT: .cfi_def_cfa_offset 32
43 ; CHECK-NEXT: .cfi_offset w30, -16
44 ; CHECK-NEXT: bl OUTLINED_FUNCTION_0
45 ; CHECK-NEXT: b.ne .LBB1_2
46 ; CHECK-NEXT: // %bb.1: // %entry
47 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
48 ; CHECK-NEXT: bl OUTLINED_FUNCTION_1
49 ; CHECK-NEXT: b _ZN2C6D0Ev
52 ; CHECK-NEXT: .LBB1_2: // %entry
53 ; CHECK-NEXT: bl __stack_chk_fail
55 %0 = load ptr, ptr %this, align 8
56 %1 = getelementptr inbounds i8, ptr %0, i64 -24
57 %2 = load i64, ptr %1, align 8
58 %3 = getelementptr inbounds i8, ptr %this, i64 %2
59 tail call void @_ZN2C6D0Ev(ptr %3)
63 define hidden void @_ZTv0_n24_N3C10D1Ev(ptr %this) minsize sspreq "target-features"="+harden-sls-retbr" {
64 ; CHECK-LABEL: _ZTv0_n24_N3C10D1Ev:
65 ; CHECK: // %bb.0: // %entry
66 ; CHECK-NEXT: sub sp, sp, #32
67 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
68 ; CHECK-NEXT: .cfi_def_cfa_offset 32
69 ; CHECK-NEXT: .cfi_offset w30, -16
70 ; CHECK-NEXT: bl OUTLINED_FUNCTION_0
71 ; CHECK-NEXT: b.ne .LBB2_2
72 ; CHECK-NEXT: // %bb.1: // %entry
73 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
74 ; CHECK-NEXT: bl OUTLINED_FUNCTION_1
75 ; CHECK-NEXT: b _ZN3C10D1Ev
78 ; CHECK-NEXT: .LBB2_2: // %entry
79 ; CHECK-NEXT: bl __stack_chk_fail
81 %0 = load ptr, ptr %this, align 8
82 %1 = getelementptr inbounds i8, ptr %0, i64 -24
83 %2 = load i64, ptr %1, align 8
84 %3 = getelementptr inbounds i8, ptr %this, i64 %2
85 tail call void @_ZN3C10D1Ev(ptr %3)
89 define hidden void @_ZTv0_n24_N3C10D0Ev(ptr %this) minsize sspreq "target-features"="+harden-sls-retbr" {
90 ; CHECK-LABEL: _ZTv0_n24_N3C10D0Ev:
91 ; CHECK: // %bb.0: // %entry
92 ; CHECK-NEXT: sub sp, sp, #32
93 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
94 ; CHECK-NEXT: .cfi_def_cfa_offset 32
95 ; CHECK-NEXT: .cfi_offset w30, -16
96 ; CHECK-NEXT: bl OUTLINED_FUNCTION_0
97 ; CHECK-NEXT: b.ne .LBB3_2
98 ; CHECK-NEXT: // %bb.1: // %entry
99 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
100 ; CHECK-NEXT: bl OUTLINED_FUNCTION_1
101 ; CHECK-NEXT: b _ZN3C10D0Ev
104 ; CHECK-NEXT: .LBB3_2: // %entry
105 ; CHECK-NEXT: bl __stack_chk_fail
107 %0 = load ptr, ptr %this, align 8
108 %1 = getelementptr inbounds i8, ptr %0, i64 -24
109 %2 = load i64, ptr %1, align 8
110 %3 = getelementptr inbounds i8, ptr %this, i64 %2
111 tail call void @_ZN3C10D0Ev(ptr %3)
115 declare void @_ZN2C6D1Ev(ptr %this)
116 declare void @_ZN3C10D1Ev(ptr %this)
117 declare void @_ZN2C6D0Ev(ptr %this)
118 declare void @_ZN3C10D0Ev(ptr %this)