]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/lib/Target/AArch64/AArch64CallingConvention.td
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
[FreeBSD/FreeBSD.git] / contrib / llvm / lib / Target / AArch64 / AArch64CallingConvention.td
1 //=- AArch64CallingConv.td - Calling Conventions for AArch64 -*- tablegen -*-=//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This describes the calling conventions for AArch64 architecture.
10 //
11 //===----------------------------------------------------------------------===//
12
13 /// CCIfAlign - Match of the original alignment of the arg
14 class CCIfAlign<string Align, CCAction A> :
15   CCIf<!strconcat("ArgFlags.getOrigAlign() == ", Align), A>;
16 /// CCIfBigEndian - Match only if we're in big endian mode.
17 class CCIfBigEndian<CCAction A> :
18   CCIf<"State.getMachineFunction().getDataLayout().isBigEndian()", A>;
19
20 //===----------------------------------------------------------------------===//
21 // ARM AAPCS64 Calling Convention
22 //===----------------------------------------------------------------------===//
23
24 let Entry = 1 in
25 def CC_AArch64_AAPCS : CallingConv<[
26   CCIfType<[iPTR], CCBitConvertToType<i64>>,
27   CCIfType<[v2f32], CCBitConvertToType<v2i32>>,
28   CCIfType<[v2f64, v4f32], CCBitConvertToType<v2i64>>,
29
30   // Big endian vectors must be passed as if they were 1-element vectors so that
31   // their lanes are in a consistent order.
32   CCIfBigEndian<CCIfType<[v2i32, v2f32, v4i16, v4f16, v8i8],
33                          CCBitConvertToType<f64>>>,
34   CCIfBigEndian<CCIfType<[v2i64, v2f64, v4i32, v4f32, v8i16, v8f16, v16i8],
35                          CCBitConvertToType<f128>>>,
36
37   // In AAPCS, an SRet is passed in X8, not X0 like a normal pointer parameter.
38   // However, on windows, in some circumstances, the SRet is passed in X0 or X1
39   // instead.  The presence of the inreg attribute indicates that SRet is
40   // passed in the alternative register (X0 or X1), not X8:
41   // - X0 for non-instance methods.
42   // - X1 for instance methods.
43
44   // The "sret" attribute identifies indirect returns.
45   // The "inreg" attribute identifies non-aggregate types.
46   // The position of the "sret" attribute identifies instance/non-instance
47   // methods.
48   // "sret" on argument 0 means non-instance methods.
49   // "sret" on argument 1 means instance methods.
50
51   CCIfInReg<CCIfType<[i64],
52     CCIfSRet<CCIfType<[i64], CCAssignToRegWithShadow<[X0, X1], [W0, W1]>>>>>,
53
54   CCIfSRet<CCIfType<[i64], CCAssignToRegWithShadow<[X8], [W8]>>>,
55
56   // Put ByVal arguments directly on the stack. Minimum size and alignment of a
57   // slot is 64-bit.
58   CCIfByVal<CCPassByVal<8, 8>>,
59
60   // The 'nest' parameter, if any, is passed in X18.
61   // Darwin uses X18 as the platform register and hence 'nest' isn't currently
62   // supported there.
63   CCIfNest<CCAssignToReg<[X18]>>,
64
65   // Pass SwiftSelf in a callee saved register.
66   CCIfSwiftSelf<CCIfType<[i64], CCAssignToRegWithShadow<[X20], [W20]>>>,
67
68   // A SwiftError is passed in X21.
69   CCIfSwiftError<CCIfType<[i64], CCAssignToRegWithShadow<[X21], [W21]>>>,
70
71   CCIfConsecutiveRegs<CCCustom<"CC_AArch64_Custom_Block">>,
72
73   // Handle i1, i8, i16, i32, i64, f32, f64 and v2f64 by passing in registers,
74   // up to eight each of GPR and FPR.
75   CCIfType<[i1, i8, i16], CCPromoteToType<i32>>,
76   CCIfType<[i32], CCAssignToRegWithShadow<[W0, W1, W2, W3, W4, W5, W6, W7],
77                                           [X0, X1, X2, X3, X4, X5, X6, X7]>>,
78   // i128 is split to two i64s, we can't fit half to register X7.
79   CCIfType<[i64], CCIfSplit<CCAssignToRegWithShadow<[X0, X2, X4, X6],
80                                                     [X0, X1, X3, X5]>>>,
81
82   // i128 is split to two i64s, and its stack alignment is 16 bytes.
83   CCIfType<[i64], CCIfSplit<CCAssignToStackWithShadow<8, 16, [X7]>>>,
84
85   CCIfType<[i64], CCAssignToRegWithShadow<[X0, X1, X2, X3, X4, X5, X6, X7],
86                                           [W0, W1, W2, W3, W4, W5, W6, W7]>>,
87   CCIfType<[f16], CCAssignToRegWithShadow<[H0, H1, H2, H3, H4, H5, H6, H7],
88                                           [Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7]>>,
89   CCIfType<[f32], CCAssignToRegWithShadow<[S0, S1, S2, S3, S4, S5, S6, S7],
90                                           [Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7]>>,
91   CCIfType<[f64], CCAssignToRegWithShadow<[D0, D1, D2, D3, D4, D5, D6, D7],
92                                           [Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7]>>,
93   CCIfType<[v1i64, v2i32, v4i16, v8i8, v1f64, v2f32, v4f16],
94            CCAssignToRegWithShadow<[D0, D1, D2, D3, D4, D5, D6, D7],
95                                    [Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7]>>,
96   CCIfType<[f128, v2i64, v4i32, v8i16, v16i8, v4f32, v2f64, v8f16],
97            CCAssignToReg<[Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7]>>,
98
99   // If more than will fit in registers, pass them on the stack instead.
100   CCIfType<[i1, i8, i16, f16], CCAssignToStack<8, 8>>,
101   CCIfType<[i32, f32], CCAssignToStack<8, 8>>,
102   CCIfType<[i64, f64, v1f64, v2f32, v1i64, v2i32, v4i16, v8i8, v4f16],
103            CCAssignToStack<8, 8>>,
104   CCIfType<[f128, v2i64, v4i32, v8i16, v16i8, v4f32, v2f64, v8f16],
105            CCAssignToStack<16, 16>>
106 ]>;
107
108 let Entry = 1 in
109 def RetCC_AArch64_AAPCS : CallingConv<[
110   CCIfType<[iPTR], CCBitConvertToType<i64>>,
111   CCIfType<[v2f32], CCBitConvertToType<v2i32>>,
112   CCIfType<[v2f64, v4f32], CCBitConvertToType<v2i64>>,
113
114   CCIfSwiftError<CCIfType<[i64], CCAssignToRegWithShadow<[X21], [W21]>>>,
115
116   // Big endian vectors must be passed as if they were 1-element vectors so that
117   // their lanes are in a consistent order.
118   CCIfBigEndian<CCIfType<[v2i32, v2f32, v4i16, v4f16, v8i8],
119                          CCBitConvertToType<f64>>>,
120   CCIfBigEndian<CCIfType<[v2i64, v2f64, v4i32, v4f32, v8i16, v8f16, v16i8],
121                          CCBitConvertToType<f128>>>,
122
123   CCIfType<[i1, i8, i16], CCPromoteToType<i32>>,
124   CCIfType<[i32], CCAssignToRegWithShadow<[W0, W1, W2, W3, W4, W5, W6, W7],
125                                           [X0, X1, X2, X3, X4, X5, X6, X7]>>,
126   CCIfType<[i64], CCAssignToRegWithShadow<[X0, X1, X2, X3, X4, X5, X6, X7],
127                                           [W0, W1, W2, W3, W4, W5, W6, W7]>>,
128   CCIfType<[f16], CCAssignToRegWithShadow<[H0, H1, H2, H3, H4, H5, H6, H7],
129                                           [Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7]>>,
130   CCIfType<[f32], CCAssignToRegWithShadow<[S0, S1, S2, S3, S4, S5, S6, S7],
131                                           [Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7]>>,
132   CCIfType<[f64], CCAssignToRegWithShadow<[D0, D1, D2, D3, D4, D5, D6, D7],
133                                           [Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7]>>,
134   CCIfType<[v1i64, v2i32, v4i16, v8i8, v1f64, v2f32, v4f16],
135       CCAssignToRegWithShadow<[D0, D1, D2, D3, D4, D5, D6, D7],
136                               [Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7]>>,
137   CCIfType<[f128, v2i64, v4i32, v8i16, v16i8, v4f32, v2f64, v8f16],
138       CCAssignToReg<[Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7]>>
139 ]>;
140
141 // Vararg functions on windows pass floats in integer registers
142 let Entry = 1 in
143 def CC_AArch64_Win64_VarArg : CallingConv<[
144   CCIfType<[f16, f32], CCPromoteToType<f64>>,
145   CCIfType<[f64], CCBitConvertToType<i64>>,
146   CCDelegateTo<CC_AArch64_AAPCS>
147 ]>;
148
149
150 // Darwin uses a calling convention which differs in only two ways
151 // from the standard one at this level:
152 //     + i128s (i.e. split i64s) don't need even registers.
153 //     + Stack slots are sized as needed rather than being at least 64-bit.
154 let Entry = 1 in
155 def CC_AArch64_DarwinPCS : CallingConv<[
156   CCIfType<[iPTR], CCBitConvertToType<i64>>,
157   CCIfType<[v2f32], CCBitConvertToType<v2i32>>,
158   CCIfType<[v2f64, v4f32, f128], CCBitConvertToType<v2i64>>,
159
160   // An SRet is passed in X8, not X0 like a normal pointer parameter.
161   CCIfSRet<CCIfType<[i64], CCAssignToRegWithShadow<[X8], [W8]>>>,
162
163   // Put ByVal arguments directly on the stack. Minimum size and alignment of a
164   // slot is 64-bit.
165   CCIfByVal<CCPassByVal<8, 8>>,
166
167   // Pass SwiftSelf in a callee saved register.
168   CCIfSwiftSelf<CCIfType<[i64], CCAssignToRegWithShadow<[X20], [W20]>>>,
169
170   // A SwiftError is passed in X21.
171   CCIfSwiftError<CCIfType<[i64], CCAssignToRegWithShadow<[X21], [W21]>>>,
172
173   CCIfConsecutiveRegs<CCCustom<"CC_AArch64_Custom_Block">>,
174
175   // Handle i1, i8, i16, i32, i64, f32, f64 and v2f64 by passing in registers,
176   // up to eight each of GPR and FPR.
177   CCIfType<[i1, i8, i16], CCPromoteToType<i32>>,
178   CCIfType<[i32], CCAssignToRegWithShadow<[W0, W1, W2, W3, W4, W5, W6, W7],
179                                           [X0, X1, X2, X3, X4, X5, X6, X7]>>,
180   // i128 is split to two i64s, we can't fit half to register X7.
181   CCIfType<[i64],
182            CCIfSplit<CCAssignToRegWithShadow<[X0, X1, X2, X3, X4, X5, X6],
183                                              [W0, W1, W2, W3, W4, W5, W6]>>>,
184   // i128 is split to two i64s, and its stack alignment is 16 bytes.
185   CCIfType<[i64], CCIfSplit<CCAssignToStackWithShadow<8, 16, [X7]>>>,
186
187   CCIfType<[i64], CCAssignToRegWithShadow<[X0, X1, X2, X3, X4, X5, X6, X7],
188                                           [W0, W1, W2, W3, W4, W5, W6, W7]>>,
189   CCIfType<[f16], CCAssignToRegWithShadow<[H0, H1, H2, H3, H4, H5, H6, H7],
190                                           [Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7]>>,
191   CCIfType<[f32], CCAssignToRegWithShadow<[S0, S1, S2, S3, S4, S5, S6, S7],
192                                           [Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7]>>,
193   CCIfType<[f64], CCAssignToRegWithShadow<[D0, D1, D2, D3, D4, D5, D6, D7],
194                                           [Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7]>>,
195   CCIfType<[v1i64, v2i32, v4i16, v8i8, v1f64, v2f32, v4f16],
196            CCAssignToRegWithShadow<[D0, D1, D2, D3, D4, D5, D6, D7],
197                                    [Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7]>>,
198   CCIfType<[v2i64, v4i32, v8i16, v16i8, v4f32, v2f64, v8f16],
199            CCAssignToReg<[Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7]>>,
200
201   // If more than will fit in registers, pass them on the stack instead.
202   CCIf<"ValVT == MVT::i1 || ValVT == MVT::i8", CCAssignToStack<1, 1>>,
203   CCIf<"ValVT == MVT::i16 || ValVT == MVT::f16", CCAssignToStack<2, 2>>,
204   CCIfType<[i32, f32], CCAssignToStack<4, 4>>,
205   CCIfType<[i64, f64, v1f64, v2f32, v1i64, v2i32, v4i16, v8i8, v4f16],
206            CCAssignToStack<8, 8>>,
207   CCIfType<[v2i64, v4i32, v8i16, v16i8, v4f32, v2f64, v8f16],
208            CCAssignToStack<16, 16>>
209 ]>;
210
211 let Entry = 1 in
212 def CC_AArch64_DarwinPCS_VarArg : CallingConv<[
213   CCIfType<[iPTR], CCBitConvertToType<i64>>,
214   CCIfType<[v2f32], CCBitConvertToType<v2i32>>,
215   CCIfType<[v2f64, v4f32, f128], CCBitConvertToType<v2i64>>,
216
217   CCIfConsecutiveRegs<CCCustom<"CC_AArch64_Custom_Stack_Block">>,
218
219   // Handle all scalar types as either i64 or f64.
220   CCIfType<[i8, i16, i32], CCPromoteToType<i64>>,
221   CCIfType<[f16, f32],     CCPromoteToType<f64>>,
222
223   // Everything is on the stack.
224   // i128 is split to two i64s, and its stack alignment is 16 bytes.
225   CCIfType<[i64], CCIfSplit<CCAssignToStack<8, 16>>>,
226   CCIfType<[i64, f64, v1i64, v2i32, v4i16, v8i8, v1f64, v2f32, v4f16],
227            CCAssignToStack<8, 8>>,
228   CCIfType<[v2i64, v4i32, v8i16, v16i8, v4f32, v2f64, v8f16],
229            CCAssignToStack<16, 16>>
230 ]>;
231
232 // The WebKit_JS calling convention only passes the first argument (the callee)
233 // in register and the remaining arguments on stack. We allow 32bit stack slots,
234 // so that WebKit can write partial values in the stack and define the other
235 // 32bit quantity as undef.
236 let Entry = 1 in
237 def CC_AArch64_WebKit_JS : CallingConv<[
238   // Handle i1, i8, i16, i32, and i64 passing in register X0 (W0).
239   CCIfType<[i1, i8, i16], CCPromoteToType<i32>>,
240   CCIfType<[i32], CCAssignToRegWithShadow<[W0], [X0]>>,
241   CCIfType<[i64], CCAssignToRegWithShadow<[X0], [W0]>>,
242
243   // Pass the remaining arguments on the stack instead.
244   CCIfType<[i32, f32], CCAssignToStack<4, 4>>,
245   CCIfType<[i64, f64], CCAssignToStack<8, 8>>
246 ]>;
247
248 let Entry = 1 in
249 def RetCC_AArch64_WebKit_JS : CallingConv<[
250   CCIfType<[i32], CCAssignToRegWithShadow<[W0, W1, W2, W3, W4, W5, W6, W7],
251                                           [X0, X1, X2, X3, X4, X5, X6, X7]>>,
252   CCIfType<[i64], CCAssignToRegWithShadow<[X0, X1, X2, X3, X4, X5, X6, X7],
253                                           [W0, W1, W2, W3, W4, W5, W6, W7]>>,
254   CCIfType<[f32], CCAssignToRegWithShadow<[S0, S1, S2, S3, S4, S5, S6, S7],
255                                           [Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7]>>,
256   CCIfType<[f64], CCAssignToRegWithShadow<[D0, D1, D2, D3, D4, D5, D6, D7],
257                                           [Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7]>>
258 ]>;
259
260 //===----------------------------------------------------------------------===//
261 // ARM64 Calling Convention for GHC
262 //===----------------------------------------------------------------------===//
263
264 // This calling convention is specific to the Glasgow Haskell Compiler.
265 // The only documentation is the GHC source code, specifically the C header
266 // file:
267 //
268 //     https://github.com/ghc/ghc/blob/master/includes/stg/MachRegs.h
269 //
270 // which defines the registers for the Spineless Tagless G-Machine (STG) that
271 // GHC uses to implement lazy evaluation. The generic STG machine has a set of
272 // registers which are mapped to appropriate set of architecture specific
273 // registers for each CPU architecture.
274 //
275 // The STG Machine is documented here:
276 //
277 //    https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/GeneratedCode
278 //
279 // The AArch64 register mapping is under the heading "The ARMv8/AArch64 ABI
280 // register mapping".
281
282 let Entry = 1 in
283 def CC_AArch64_GHC : CallingConv<[
284   CCIfType<[iPTR], CCBitConvertToType<i64>>,
285
286   // Handle all vector types as either f64 or v2f64.
287   CCIfType<[v1i64, v2i32, v4i16, v8i8, v2f32], CCBitConvertToType<f64>>,
288   CCIfType<[v2i64, v4i32, v8i16, v16i8, v4f32, f128], CCBitConvertToType<v2f64>>,
289
290   CCIfType<[v2f64], CCAssignToReg<[Q4, Q5]>>,
291   CCIfType<[f32], CCAssignToReg<[S8, S9, S10, S11]>>,
292   CCIfType<[f64], CCAssignToReg<[D12, D13, D14, D15]>>,
293
294   // Promote i8/i16/i32 arguments to i64.
295   CCIfType<[i8, i16, i32], CCPromoteToType<i64>>,
296
297   // Pass in STG registers: Base, Sp, Hp, R1, R2, R3, R4, R5, R6, SpLim
298   CCIfType<[i64], CCAssignToReg<[X19, X20, X21, X22, X23, X24, X25, X26, X27, X28]>>
299 ]>;
300
301 // FIXME: LR is only callee-saved in the sense that *we* preserve it and are
302 // presumably a callee to someone. External functions may not do so, but this
303 // is currently safe since BL has LR as an implicit-def and what happens after a
304 // tail call doesn't matter.
305 //
306 // It would be better to model its preservation semantics properly (create a
307 // vreg on entry, use it in RET & tail call generation; make that vreg def if we
308 // end up saving LR as part of a call frame). Watch this space...
309 def CSR_AArch64_AAPCS : CalleeSavedRegs<(add LR, FP, X19, X20, X21, X22,
310                                            X23, X24, X25, X26, X27, X28,
311                                            D8,  D9,  D10, D11,
312                                            D12, D13, D14, D15)>;
313
314 // Win64 has unwinding codes for an (FP,LR) pair, save_fplr and save_fplr_x.
315 // We put FP before LR, so that frame lowering logic generates (FP,LR) pairs,
316 // and not (LR,FP) pairs.
317 def CSR_Win_AArch64_AAPCS : CalleeSavedRegs<(add FP, LR, X19, X20, X21, X22,
318                                                X23, X24, X25, X26, X27, X28,
319                                                D8, D9, D10, D11,
320                                                D12, D13, D14, D15)>;
321
322 // AArch64 PCS for vector functions (VPCS)
323 // must (additionally) preserve full Q8-Q23 registers
324 def CSR_AArch64_AAVPCS : CalleeSavedRegs<(add LR, FP, X19, X20, X21, X22,
325                                           X23, X24, X25, X26, X27, X28,
326                                           (sequence "Q%u", 8, 23))>;
327
328 // Constructors and destructors return 'this' in the iOS 64-bit C++ ABI; since
329 // 'this' and the pointer return value are both passed in X0 in these cases,
330 // this can be partially modelled by treating X0 as a callee-saved register;
331 // only the resulting RegMask is used; the SaveList is ignored
332 //
333 // (For generic ARM 64-bit ABI code, clang will not generate constructors or
334 // destructors with 'this' returns, so this RegMask will not be used in that
335 // case)
336 def CSR_AArch64_AAPCS_ThisReturn : CalleeSavedRegs<(add CSR_AArch64_AAPCS, X0)>;
337
338 def CSR_AArch64_AAPCS_SwiftError
339     : CalleeSavedRegs<(sub CSR_AArch64_AAPCS, X21)>;
340
341 // The function used by Darwin to obtain the address of a thread-local variable
342 // guarantees more than a normal AAPCS function. x16 and x17 are used on the
343 // fast path for calculation, but other registers except X0 (argument/return)
344 // and LR (it is a call, after all) are preserved.
345 def CSR_AArch64_TLS_Darwin
346     : CalleeSavedRegs<(add (sub (sequence "X%u", 1, 28), X16, X17),
347                            FP,
348                            (sequence "Q%u", 0, 31))>;
349
350 // We can only handle a register pair with adjacent registers, the register pair
351 // should belong to the same class as well. Since the access function on the
352 // fast path calls a function that follows CSR_AArch64_TLS_Darwin,
353 // CSR_AArch64_CXX_TLS_Darwin should be a subset of CSR_AArch64_TLS_Darwin.
354 def CSR_AArch64_CXX_TLS_Darwin
355     : CalleeSavedRegs<(add CSR_AArch64_AAPCS,
356                            (sub (sequence "X%u", 1, 28), X15, X16, X17, X18),
357                            (sequence "D%u", 0, 31))>;
358
359 // CSRs that are handled by prologue, epilogue.
360 def CSR_AArch64_CXX_TLS_Darwin_PE
361     : CalleeSavedRegs<(add LR, FP)>;
362
363 // CSRs that are handled explicitly via copies.
364 def CSR_AArch64_CXX_TLS_Darwin_ViaCopy
365     : CalleeSavedRegs<(sub CSR_AArch64_CXX_TLS_Darwin, LR, FP)>;
366
367 // The ELF stub used for TLS-descriptor access saves every feasible
368 // register. Only X0 and LR are clobbered.
369 def CSR_AArch64_TLS_ELF
370     : CalleeSavedRegs<(add (sequence "X%u", 1, 28), FP,
371                            (sequence "Q%u", 0, 31))>;
372
373 def CSR_AArch64_AllRegs
374     : CalleeSavedRegs<(add (sequence "W%u", 0, 30), WSP,
375                            (sequence "X%u", 0, 28), FP, LR, SP,
376                            (sequence "B%u", 0, 31), (sequence "H%u", 0, 31),
377                            (sequence "S%u", 0, 31), (sequence "D%u", 0, 31),
378                            (sequence "Q%u", 0, 31))>;
379
380 def CSR_AArch64_NoRegs : CalleeSavedRegs<(add)>;
381
382 def CSR_AArch64_RT_MostRegs :  CalleeSavedRegs<(add CSR_AArch64_AAPCS,
383                                                 (sequence "X%u", 9, 15))>;
384
385 def CSR_AArch64_StackProbe_Windows
386     : CalleeSavedRegs<(add (sequence "X%u", 0, 15),
387                            (sequence "X%u", 18, 28), FP, SP,
388                            (sequence "Q%u", 0, 31))>;
389
390 // Variants of the standard calling conventions for shadow call stack.
391 // These all preserve x18 in addition to any other registers.
392 def CSR_AArch64_NoRegs_SCS
393     : CalleeSavedRegs<(add CSR_AArch64_NoRegs, X18)>;
394 def CSR_AArch64_AllRegs_SCS
395     : CalleeSavedRegs<(add CSR_AArch64_AllRegs, X18)>;
396 def CSR_AArch64_CXX_TLS_Darwin_SCS
397     : CalleeSavedRegs<(add CSR_AArch64_CXX_TLS_Darwin, X18)>;
398 def CSR_AArch64_AAPCS_SwiftError_SCS
399     : CalleeSavedRegs<(add CSR_AArch64_AAPCS_SwiftError, X18)>;
400 def CSR_AArch64_RT_MostRegs_SCS
401     : CalleeSavedRegs<(add CSR_AArch64_RT_MostRegs, X18)>;
402 def CSR_AArch64_AAVPCS_SCS
403     : CalleeSavedRegs<(add CSR_AArch64_AAVPCS, X18)>;
404 def CSR_AArch64_AAPCS_SCS
405     : CalleeSavedRegs<(add CSR_AArch64_AAPCS, X18)>;