llvm.org GIT mirror llvm / fe532ad
Enable FastISel on ARM for Linux and NaCl, not MCJIT This is a resubmit of r182877, which was reverted because it broken MCJIT tests on ARM. The patch leaves MCJIT on ARM as it was before: only enabled for iOS. I've CC'ed people from the original review and revert. FastISel was only enabled for iOS ARM and Thumb2, this patch enables it for ARM (not Thumb2) on Linux and NaCl, but not MCJIT. Thumb2 support needs a bit more work, mainly around register class restrictions. The patch punts to SelectionDAG when doing TLS relocation on non-Darwin targets. I will fix this and other FastISel-to-SelectionDAG failures in a separate patch. The patch also forces FastISel to retain frame pointers: iOS always keeps them for backtracking (so emitted code won't change because of this), but Linux was getting much worse code that was incorrect when using big frames (such as test-suite's lencod). I'll also fix this in a later patch, it will probably require a peephole so that FastISel doesn't rematerialize frame pointers back-to-back. The test changes are straightforward, similar to: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130513/174279.html They also add a vararg test that got dropped in that change. I ran all of lnt test-suite on A15 hardware with --optimize-option=-O0 and all the tests pass. All the tests also pass on x86 make check-all. I also re-ran the check-all tests that failed on ARM, and they all seem to pass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183966 91177308-0d34-0410-b5e6-96231b3b80d8 JF Bastien 6 years ago
27 changed file(s) with 111 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
8787 FeaturesStr = Features.getString();
8888 }
8989
90 // FIXME: non-iOS ARM FastISel is broken with MCJIT.
91 if (UseMCJIT &&
92 TheTriple.getArch() == Triple::arm &&
93 TheTriple.getOS() != Triple::IOS &&
94 OptLevel == CodeGenOpt::None) {
95 OptLevel = CodeGenOpt::Less;
96 }
97
9098 // Allocate a target...
9199 TargetMachine *Target = TheTarget->createTargetMachine(TheTriple.getTriple(),
92100 MCPU, FeaturesStr,
628628 (const TargetRegisterClass*)&ARM::rGPRRegClass :
629629 (const TargetRegisterClass*)&ARM::GPRRegClass;
630630 unsigned DestReg = createResultReg(RC);
631
632 // FastISel TLS support on non-Darwin is broken, punt to SelectionDAG.
633 const GlobalVariable *GVar = dyn_cast(GV);
634 bool IsThreadLocal = GVar && GVar->isThreadLocal();
635 if (!Subtarget->isTargetDarwin() && IsThreadLocal) return 0;
631636
632637 // Use movw+movt when possible, it avoids constant pool entries.
633638 // Darwin targets don't support movt with Reloc::Static, see
30433048 namespace llvm {
30443049 FastISel *ARM::createFastISel(FunctionLoweringInfo &funcInfo,
30453050 const TargetLibraryInfo *libInfo) {
3046 // Completely untested on non-iOS.
30473051 const TargetMachine &TM = funcInfo.MF->getTarget();
30483052
3049 // Darwin and thumb1 only for now.
30503053 const ARMSubtarget *Subtarget = &TM.getSubtarget();
3051 if (Subtarget->isTargetIOS() && !Subtarget->isThumb1Only())
3054 // Thumb2 support on iOS; ARM support on iOS, Linux and NaCl.
3055 bool UseFastISel = false;
3056 UseFastISel |= Subtarget->isTargetIOS() && !Subtarget->isThumb1Only();
3057 UseFastISel |= Subtarget->isTargetLinux() && !Subtarget->isThumb();
3058 UseFastISel |= Subtarget->isTargetNaCl() && !Subtarget->isThumb();
3059
3060 if (UseFastISel) {
3061 // iOS always has a FP for backtracking, force other targets
3062 // to keep their FP when doing FastISel. The emitted code is
3063 // currently superior, and in cases like test-suite's lencod
3064 // FastISel isn't quite correct when FP is eliminated.
3065 TM.Options.NoFramePointerElim = true;
30523066 return new ARMFastISel(funcInfo, libInfo);
3067 }
30533068 return 0;
30543069 }
30553070 }
0 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-apple-darwin | FileCheck %s --check-prefix=ARM
1 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-linux-gnueabi | FileCheck %s --check-prefix=ARM
12 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-darwin | FileCheck %s --check-prefix=THUMB
23
34 %struct.A = type { i32, [2 x [2 x i32]], i8, [3 x [3 x [3 x i32]]] }
0 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios | FileCheck %s --check-prefix=ARM
1 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-linux-gnueabi | FileCheck %s --check-prefix=ARM
12 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
23
34 ; Test add with non-legal types
0 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios | FileCheck %s --check-prefix=ARM
1 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-linux-gnueabi | FileCheck %s --check-prefix=ARM
12 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
23
34 define i32 @t1(i32 %a, i32 %b) nounwind uwtable ssp {
0 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios | FileCheck %s --check-prefix=ARM
1 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-linux-gnueabi | FileCheck %s --check-prefix=ARM
12 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
23
34 ; Fast-isel can't handle non-double multi-reg retvals.
0 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios | FileCheck %s --check-prefix=ARM
1 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-linux-gnueabi | FileCheck %s --check-prefix=ARM
12 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
23 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios -arm-long-calls | FileCheck %s --check-prefix=ARM-LONG
4 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-linux-gnueabi -arm-long-calls | FileCheck %s --check-prefix=ARM-LONG
35 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios -arm-long-calls | FileCheck %s --check-prefix=THUMB-LONG
46 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios -mattr=-vfp2 | FileCheck %s --check-prefix=ARM-NOVFP
7 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-linux-gnueabi -mattr=-vfp2 | FileCheck %s --check-prefix=ARM-NOVFP
58 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios -mattr=-vfp2 | FileCheck %s --check-prefix=THUMB-NOVFP
69
710 ; Note that some of these tests assume that relocations are either
0 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios | FileCheck %s --check-prefix=ARM
1 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-linux-gnueabi | FileCheck %s --check-prefix=ARM
12 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
23
34 define void @t1a(float %a) uwtable ssp {
0 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios | FileCheck %s --check-prefix=ARM
1 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-linux-gnueabi | FileCheck %s --check-prefix=ARM
12 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
23
34 ; Test sitofp
0 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -mtriple=thumbv7-apple-darwin
1 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -mtriple=thumbv7-linux-gnueabi
12
23 %union.anon = type { <16 x i32> }
34
0 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -mtriple=thumbv7-apple-darwin
1 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -mtriple=thumbv7-linux-gnueabi
12 ; rdar://9515076
23 ; (Make sure this doesn't crash.)
34
0 ; RUN: llc < %s -O0 -fast-isel-abort -mtriple=armv7-apple-ios | FileCheck %s --check-prefix=v7
1 ; RUN: llc < %s -O0 -fast-isel-abort -mtriple=armv7-linux-gnueabi | FileCheck %s --check-prefix=v7
12 ; RUN: llc < %s -O0 -fast-isel-abort -mtriple=armv4t-apple-ios | FileCheck %s --check-prefix=prev6
3 ; RUN: llc < %s -O0 -fast-isel-abort -mtriple=armv4t-linux-gnueabi | FileCheck %s --check-prefix=prev6
24 ; RUN: llc < %s -O0 -fast-isel-abort -mtriple=armv5-apple-ios | FileCheck %s --check-prefix=prev6
5 ; RUN: llc < %s -O0 -fast-isel-abort -mtriple=armv5-linux-gnueabi | FileCheck %s --check-prefix=prev6
36 ; RUN: llc < %s -O0 -fast-isel-abort -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=v7
47
58 ; Can't test pre-ARMv6 Thumb because ARM FastISel currently only supports
0 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-apple-darwin | FileCheck %s --check-prefix=ARM
1 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-linux-gnueabi | FileCheck %s --check-prefix=ARM
12 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-darwin | FileCheck %s --check-prefix=THUMB
23
34 @a = global i8 1, align 1
4545 ; LINUX-ARM: frameaddr_index1:
4646 ; LINUX-ARM: push {r11}
4747 ; LINUX-ARM: mov r11, sp
48 ; LINUX-ARM: mov r0, r11
49 ; LINUX-ARM: ldr r0, [r0]
48 ; LINUX-ARM: ldr r0, [r11]
5049
5150 ; LINUX-THUMB2: frameaddr_index1:
5251 ; LINUX-THUMB2: str r7, [sp, #-4]!
7978 ; LINUX-ARM: frameaddr_index3:
8079 ; LINUX-ARM: push {r11}
8180 ; LINUX-ARM: mov r11, sp
82 ; LINUX-ARM: mov r0, r11
83 ; LINUX-ARM: ldr r0, [r0]
81 ; LINUX-ARM: ldr r0, [r11]
8482 ; LINUX-ARM: ldr r0, [r0]
8583 ; LINUX-ARM: ldr r0, [r0]
8684
0 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios | FileCheck %s --check-prefix=ARM
1 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-linux-gnueabi | FileCheck %s --check-prefix=ARM
12 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
23
34 define i32 @icmp_i16_signed(i16 %a, i16 %b) nounwind {
0 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios | FileCheck %s --check-prefix=ARM
1 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-linux-gnueabi | FileCheck %s --check-prefix=ARM
12 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
23
34 define void @t1(i8* %x) {
0 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios | FileCheck %s --check-prefix=ARM
1 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-linux-gnueabi | FileCheck %s --check-prefix=ARM
12 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
23 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios -arm-long-calls | FileCheck %s --check-prefix=ARM-LONG
4 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-linux-gnueabi -arm-long-calls | FileCheck %s --check-prefix=ARM-LONG
35 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios -arm-long-calls | FileCheck %s --check-prefix=THUMB-LONG
46
57 ; Note that some of these tests assume that relocations are either
1921 ; ARM: and r1, r1, #255
2022 ; ARM: bl {{_?}}memset
2123 ; ARM-LONG: t1
22 ; ARM-LONG: movw r3, :lower16:L_memset$non_lazy_ptr
23 ; ARM-LONG: movt r3, :upper16:L_memset$non_lazy_ptr
24 ; ARM-LONG: {{(movw r3, :lower16:L_memset\$non_lazy_ptr)|(ldr r3, .LCPI)}}
25 ; ARM-LONG: {{(movt r3, :upper16:L_memset\$non_lazy_ptr)?}}
2426 ; ARM-LONG: ldr r3, [r3]
2527 ; ARM-LONG: blx r3
2628 ; THUMB: t1
5759 ; ARM: ldr r1, [sp[[SLOT]]] @ 4-byte Reload
5860 ; ARM: bl {{_?}}memcpy
5961 ; ARM-LONG: t2
60 ; ARM-LONG: movw r3, :lower16:L_memcpy$non_lazy_ptr
61 ; ARM-LONG: movt r3, :upper16:L_memcpy$non_lazy_ptr
62 ; ARM-LONG: {{(movw r3, :lower16:L_memcpy\$non_lazy_ptr)|(ldr r3, .LCPI)}}
63 ; ARM-LONG: {{(movt r3, :upper16:L_memcpy\$non_lazy_ptr)?}}
6264 ; ARM-LONG: ldr r3, [r3]
6365 ; ARM-LONG: blx r3
6466 ; THUMB: t2
9597 ; ARM: mov r0, r1
9698 ; ARM: bl {{_?}}memmove
9799 ; ARM-LONG: t3
98 ; ARM-LONG: movw r3, :lower16:L_memmove$non_lazy_ptr
99 ; ARM-LONG: movt r3, :upper16:L_memmove$non_lazy_ptr
100 ; ARM-LONG: {{(movw r3, :lower16:L_memmove\$non_lazy_ptr)|(ldr r3, .LCPI)}}
101 ; ARM-LONG: {{(movt r3, :upper16:L_memmove\$non_lazy_ptr)?}}
100102 ; ARM-LONG: ldr r3, [r3]
101103 ; ARM-LONG: blx r3
102104 ; THUMB: t3
0 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios | FileCheck %s --check-prefix=ARM
1 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-linux-gnueabi | FileCheck %s --check-prefix=ARM
12 ; rdar://10418009
23
34 define zeroext i16 @t1(i16* nocapture %a) nounwind uwtable readonly ssp {
0 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios | FileCheck %s --check-prefix=ARM
1 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-linux-gnueabi | FileCheck %s --check-prefix=ARM
12 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
23 ; rdar://10412592
34
2525 ; ARMv7-ELF: LoadGV
2626 ; ARMv7-ELF: ldr r[[reg2:[0-9]+]],
2727 ; ARMv7-ELF: ldr r[[reg3:[0-9]+]],
28 ; ARMv7-ELF: ldr r[[reg2]], [r[[reg2]], r[[reg3]]]
28 ; ARMv7-ELF: ldr r[[reg2]], [r[[reg3]], r[[reg2]]]
2929 %tmp = load i32* @g
3030 ret i32 %tmp
3131 }
5454 ; ARMv7-ELF: LoadIndirectSymbol
5555 ; ARMv7-ELF: ldr r[[reg5:[0-9]+]],
5656 ; ARMv7-ELF: ldr r[[reg6:[0-9]+]],
57 ; ARMv7-ELF: ldr r[[reg5]], [r[[reg5]], r[[reg6]]]
57 ; ARMv7-ELF: ldr r[[reg5]], [r[[reg6]], r[[reg5]]]
5858 %tmp = load i32* @i
5959 ret i32 %tmp
6060 }
0 ; RUN: llc -O0 -verify-machineinstrs -mtriple=armv7-apple-darwin < %s
1 ; RUN: llc -O0 -verify-machineinstrs -mtriple=armv7-linux-gnueabi < %s
12
23 define i32 @main() nounwind ssp {
34 entry:
0 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios | FileCheck %s
1 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-linux-gnueabi | FileCheck %s
12 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s
23
34 ; Sign-extend of i1 currently not supported by fast-isel
0 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios | FileCheck %s --check-prefix=ARM
1 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-linux-gnueabi | FileCheck %s --check-prefix=ARM
12 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
23
34 define i32 @t1(i1 %c) nounwind readnone {
0 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios | FileCheck %s --check-prefix=ARM
1 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-linux-gnueabi | FileCheck %s --check-prefix=ARM
12
23 define i32 @shl() nounwind ssp {
34 entry:
0 ; RUN: llc < %s -mtriple=thumbv7-apple-darwin -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=static -arm-long-calls | FileCheck -check-prefix=LONG %s
1 ; RUN: llc < %s -mtriple=thumbv7-linux-gnueabi -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=static -arm-long-calls | FileCheck -check-prefix=LONG %s
12 ; RUN: llc < %s -mtriple=thumbv7-apple-darwin -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=static | FileCheck -check-prefix=NORM %s
3 ; RUN: llc < %s -mtriple=thumbv7-linux-gnueabi -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=static | FileCheck -check-prefix=NORM %s
24
35 define void @myadd(float* %sum, float* %addend) nounwind {
46 entry:
0 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios | FileCheck %s --check-prefix=ARM
1 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-linux-gnueabi | FileCheck %s --check-prefix=ARM
2 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
3
4 define i32 @VarArg() nounwind {
5 entry:
6 %i = alloca i32, align 4
7 %j = alloca i32, align 4
8 %k = alloca i32, align 4
9 %m = alloca i32, align 4
10 %n = alloca i32, align 4
11 %tmp = alloca i32, align 4
12 %0 = load i32* %i, align 4
13 %1 = load i32* %j, align 4
14 %2 = load i32* %k, align 4
15 %3 = load i32* %m, align 4
16 %4 = load i32* %n, align 4
17 ; ARM: VarArg
18 ; ARM: mov [[FP:r[0-9]+]], sp
19 ; ARM: sub sp, sp, #32
20 ; ARM: movw r0, #5
21 ; ARM: ldr r1, {{\[}}[[FP]], #-4]
22 ; ARM: ldr r2, {{\[}}[[FP]], #-8]
23 ; ARM: ldr r3, {{\[}}[[FP]], #-12]
24 ; ARM: ldr [[Ra:r[0-9]+]], [sp, #16]
25 ; ARM: ldr [[Rb:[lr]+[0-9]*]], [sp, #12]
26 ; ARM: str [[Ra]], [sp]
27 ; ARM: str [[Rb]], [sp, #4]
28 ; ARM: bl {{_?CallVariadic}}
29 ; THUMB: sub sp, #32
30 ; THUMB: movs r0, #5
31 ; THUMB: movt r0, #0
32 ; THUMB: ldr r1, [sp, #28]
33 ; THUMB: ldr r2, [sp, #24]
34 ; THUMB: ldr r3, [sp, #20]
35 ; THUMB: ldr.w {{[a-z0-9]+}}, [sp, #16]
36 ; THUMB: ldr.w {{[a-z0-9]+}}, [sp, #12]
37 ; THUMB: str.w {{[a-z0-9]+}}, [sp]
38 ; THUMB: str.w {{[a-z0-9]+}}, [sp, #4]
39 ; THUMB: bl {{_?}}CallVariadic
40 %call = call i32 (i32, ...)* @CallVariadic(i32 5, i32 %0, i32 %1, i32 %2, i32 %3, i32 %4)
41 store i32 %call, i32* %tmp, align 4
42 %5 = load i32* %tmp, align 4
43 ret i32 %5
44 }
45
46 declare i32 @CallVariadic(i32, ...)
0 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios | FileCheck %s --check-prefix=ARM
1 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-linux-gnueabi | FileCheck %s --check-prefix=ARM
12 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
23
34 ; Very basic fast-isel functionality.