1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -run-pass=regallocfast,prologepilog -simplify-mir -o - %s | FileCheck %s
4 # This test checks that the MIRParser correctly clobbers the registers
5 # that are not preserved by the unwinder (when the MIR contains an EH pad).
8 source_filename = "<stdin>"
9 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
10 target triple = "aarch64-unknown-linux-gnu"
12 define aarch64_vector_pcs <4 x i32> @invoke_callee_may_throw_neon(<4 x i32> %v) personality i8 0 {
13 %result = invoke aarch64_vector_pcs <4 x i32> @may_throw_neon(<4 x i32> %v)
14 to label %.Lcontinue unwind label %.Lunwind
16 .Lcontinue: ; preds = %0
19 .Lunwind: ; preds = %0
20 %lp = landingpad { ptr, i32 }
25 declare aarch64_vector_pcs <4 x i32> @may_throw_neon(<4 x i32>)
29 name: invoke_callee_may_throw_neon
34 tracksRegLiveness: true
36 - { id: 0, class: fpr128 }
37 - { id: 1, class: fpr128 }
49 machineFunctionInfo: {}
51 ; CHECK-LABEL: name: invoke_callee_may_throw_neon
52 ; CHECK: bb.0 (%ir-block.0):
53 ; CHECK: successors: %bb.1, %bb.2
54 ; CHECK: liveins: $q0, $q22, $q23, $q20, $q21, $q18, $q19, $q16, $q17, $q14, $q15, $q12, $q13, $q10, $q11, $q8, $q9, $lr, $fp
55 ; CHECK: $sp = frame-setup SUBXri $sp, 304, 0
56 ; CHECK: frame-setup STPQi killed $q23, killed $q22, $sp, 2 :: (store (s128) into %stack.19), (store (s128) into %stack.18)
57 ; CHECK: frame-setup STPQi killed $q21, killed $q20, $sp, 4 :: (store (s128) into %stack.17), (store (s128) into %stack.16)
58 ; CHECK: frame-setup STPQi killed $q19, killed $q18, $sp, 6 :: (store (s128) into %stack.15), (store (s128) into %stack.14)
59 ; CHECK: frame-setup STPQi killed $q17, killed $q16, $sp, 8 :: (store (s128) into %stack.13), (store (s128) into %stack.12)
60 ; CHECK: frame-setup STPQi killed $q15, killed $q14, $sp, 10 :: (store (s128) into %stack.11), (store (s128) into %stack.10)
61 ; CHECK: frame-setup STPQi killed $q13, killed $q12, $sp, 12 :: (store (s128) into %stack.9), (store (s128) into %stack.8)
62 ; CHECK: frame-setup STPQi killed $q11, killed $q10, $sp, 14 :: (store (s128) into %stack.7), (store (s128) into %stack.6)
63 ; CHECK: frame-setup STPQi killed $q9, killed $q8, $sp, 16 :: (store (s128) into %stack.5), (store (s128) into %stack.4)
64 ; CHECK: frame-setup STPXi killed $fp, killed $lr, $sp, 36 :: (store (s64) into %stack.3), (store (s64) into %stack.2)
65 ; CHECK: frame-setup CFI_INSTRUCTION def_cfa_offset 304
66 ; CHECK: frame-setup CFI_INSTRUCTION offset $w30, -8
67 ; CHECK: frame-setup CFI_INSTRUCTION offset $w29, -16
68 ; CHECK: frame-setup CFI_INSTRUCTION offset $b8, -32
69 ; CHECK: frame-setup CFI_INSTRUCTION offset $b9, -48
70 ; CHECK: frame-setup CFI_INSTRUCTION offset $b10, -64
71 ; CHECK: frame-setup CFI_INSTRUCTION offset $b11, -80
72 ; CHECK: frame-setup CFI_INSTRUCTION offset $b12, -96
73 ; CHECK: frame-setup CFI_INSTRUCTION offset $b13, -112
74 ; CHECK: frame-setup CFI_INSTRUCTION offset $b14, -128
75 ; CHECK: frame-setup CFI_INSTRUCTION offset $b15, -144
76 ; CHECK: frame-setup CFI_INSTRUCTION offset $b16, -160
77 ; CHECK: frame-setup CFI_INSTRUCTION offset $b17, -176
78 ; CHECK: frame-setup CFI_INSTRUCTION offset $b18, -192
79 ; CHECK: frame-setup CFI_INSTRUCTION offset $b19, -208
80 ; CHECK: frame-setup CFI_INSTRUCTION offset $b20, -224
81 ; CHECK: frame-setup CFI_INSTRUCTION offset $b21, -240
82 ; CHECK: frame-setup CFI_INSTRUCTION offset $b22, -256
83 ; CHECK: frame-setup CFI_INSTRUCTION offset $b23, -272
84 ; CHECK: STRQui $q0, $sp, 0 :: (store (s128) into %stack.1)
85 ; CHECK: EH_LABEL <mcsymbol .Ltmp0>
86 ; CHECK: BL @may_throw_neon, csr_aarch64_aavpcs, implicit-def dead $lr, implicit $sp, implicit killed $q0, implicit-def $q0
87 ; CHECK: STRQui killed $q0, $sp, 1 :: (store (s128) into %stack.0)
88 ; CHECK: EH_LABEL <mcsymbol .Ltmp1>
90 ; CHECK: bb.1..Lcontinue:
91 ; CHECK: $q0 = LDRQui $sp, 1 :: (load (s128) from %stack.0)
92 ; CHECK: $fp, $lr = frame-destroy LDPXi $sp, 36 :: (load (s64) from %stack.3), (load (s64) from %stack.2)
93 ; CHECK: $q9, $q8 = frame-destroy LDPQi $sp, 16 :: (load (s128) from %stack.5), (load (s128) from %stack.4)
94 ; CHECK: $q11, $q10 = frame-destroy LDPQi $sp, 14 :: (load (s128) from %stack.7), (load (s128) from %stack.6)
95 ; CHECK: $q13, $q12 = frame-destroy LDPQi $sp, 12 :: (load (s128) from %stack.9), (load (s128) from %stack.8)
96 ; CHECK: $q15, $q14 = frame-destroy LDPQi $sp, 10 :: (load (s128) from %stack.11), (load (s128) from %stack.10)
97 ; CHECK: $q17, $q16 = frame-destroy LDPQi $sp, 8 :: (load (s128) from %stack.13), (load (s128) from %stack.12)
98 ; CHECK: $q19, $q18 = frame-destroy LDPQi $sp, 6 :: (load (s128) from %stack.15), (load (s128) from %stack.14)
99 ; CHECK: $q21, $q20 = frame-destroy LDPQi $sp, 4 :: (load (s128) from %stack.17), (load (s128) from %stack.16)
100 ; CHECK: $q23, $q22 = frame-destroy LDPQi $sp, 2 :: (load (s128) from %stack.19), (load (s128) from %stack.18)
101 ; CHECK: $sp = frame-destroy ADDXri $sp, 304, 0
102 ; CHECK: RET_ReallyLR implicit killed $q0
103 ; CHECK: bb.2..Lunwind (landing-pad):
104 ; CHECK: liveins: $x0, $x1
105 ; CHECK: EH_LABEL <mcsymbol .Ltmp2>
106 ; CHECK: $q0 = LDRQui $sp, 0 :: (load (s128) from %stack.1)
107 ; CHECK: $fp, $lr = frame-destroy LDPXi $sp, 36 :: (load (s64) from %stack.3), (load (s64) from %stack.2)
108 ; CHECK: $q9, $q8 = frame-destroy LDPQi $sp, 16 :: (load (s128) from %stack.5), (load (s128) from %stack.4)
109 ; CHECK: $q11, $q10 = frame-destroy LDPQi $sp, 14 :: (load (s128) from %stack.7), (load (s128) from %stack.6)
110 ; CHECK: $q13, $q12 = frame-destroy LDPQi $sp, 12 :: (load (s128) from %stack.9), (load (s128) from %stack.8)
111 ; CHECK: $q15, $q14 = frame-destroy LDPQi $sp, 10 :: (load (s128) from %stack.11), (load (s128) from %stack.10)
112 ; CHECK: $q17, $q16 = frame-destroy LDPQi $sp, 8 :: (load (s128) from %stack.13), (load (s128) from %stack.12)
113 ; CHECK: $q19, $q18 = frame-destroy LDPQi $sp, 6 :: (load (s128) from %stack.15), (load (s128) from %stack.14)
114 ; CHECK: $q21, $q20 = frame-destroy LDPQi $sp, 4 :: (load (s128) from %stack.17), (load (s128) from %stack.16)
115 ; CHECK: $q23, $q22 = frame-destroy LDPQi $sp, 2 :: (load (s128) from %stack.19), (load (s128) from %stack.18)
116 ; CHECK: $sp = frame-destroy ADDXri $sp, 304, 0
117 ; CHECK: RET_ReallyLR implicit killed $q0
119 successors: %bb.1, %bb.2
123 EH_LABEL <mcsymbol .Ltmp0>
124 ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
126 BL @may_throw_neon, csr_aarch64_aavpcs, implicit-def $lr, implicit $sp, implicit $q0, implicit-def $q0
128 ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
129 EH_LABEL <mcsymbol .Ltmp1>
134 RET_ReallyLR implicit $q0
136 bb.2..Lunwind (landing-pad):
139 EH_LABEL <mcsymbol .Ltmp2>
141 RET_ReallyLR implicit $q0