llvm.org GIT mirror llvm / 4173058
[ARM] Add support for nest attribute using r12 Register r12 ('ip') is used by GCC for this purpose and hence is used here. As discussed on the GCC mailing list, the register choice is an ABI issue and so choosing the same register as GCC means __builtin_call_with_static_chain is compatible. A similar patch has just gone in the AArch64 backend, so this is just the ARM counterpart, following the same discussion. Patch by Stephen Cross. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241996 91177308-0d34-0410-b5e6-96231b3b80d8 Renato Golin 4 years ago
2 changed file(s) with 24 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
141141 // Handles byval parameters.
142142 CCIfByVal>,
143143
144 // The 'nest' parameter, if any, is passed in R12.
145 CCIfNest>,
146
144147 // Handle all vector types as either f64 or v2f64.
145148 CCIfType<[v1i64, v2i32, v4i16, v8i8, v2f32], CCBitConvertToType>,
146149 CCIfType<[v2i64, v4i32, v8i16, v16i8, v4f32], CCBitConvertToType>,
0 ; RUN: llc -mtriple=arm-eabi %s -o - | FileCheck %s
1
2 ; Tests that the 'nest' parameter attribute causes the relevant parameter to be
3 ; passed in the right register.
4
5 define i8* @nest_receiver(i8* nest %arg) nounwind {
6 ; CHECK-LABEL: nest_receiver:
7 ; CHECK: @ BB#0:
8 ; CHECK-NEXT: mov r0, r12
9 ; CHECK-NEXT: mov pc, lr
10 ret i8* %arg
11 }
12
13 define i8* @nest_caller(i8* %arg) nounwind {
14 ; CHECK-LABEL: nest_caller:
15 ; CHECK: mov r12, r0
16 ; CHECK-NEXT: bl nest_receiver
17 ; CHECK: mov pc, lr
18 %result = call i8* @nest_receiver(i8* nest %arg)
19 ret i8* %result
20 }