llvm.org GIT mirror llvm / 9e3e730
Revert r182937 and r182877. r182877 broke MCJIT tests on ARM and r182937 was working around another failure by r182877. This should make the ARM bots green. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182960 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 6 years ago
26 changed file(s) with 16 addition(s) and 100 deletion(s). Raw diff Collapse all Expand all
626626 (const TargetRegisterClass*)&ARM::rGPRRegClass :
627627 (const TargetRegisterClass*)&ARM::GPRRegClass;
628628 unsigned DestReg = createResultReg(RC);
629
630 // FastISel TLS support on non-Darwin is broken, punt to SelectionDAG.
631 const GlobalVariable *GVar = dyn_cast(GV);
632 bool IsThreadLocal = GVar && GVar->isThreadLocal();
633 if (!Subtarget->isTargetDarwin() && IsThreadLocal) return 0;
634629
635630 // Use movw+movt when possible, it avoids constant pool entries.
636631 // Darwin targets don't support movt with Reloc::Static, see
29652960 namespace llvm {
29662961 FastISel *ARM::createFastISel(FunctionLoweringInfo &funcInfo,
29672962 const TargetLibraryInfo *libInfo) {
2963 // Completely untested on non-iOS.
29682964 const TargetMachine &TM = funcInfo.MF->getTarget();
29692965
2966 // Darwin and thumb1 only for now.
29702967 const ARMSubtarget *Subtarget = &TM.getSubtarget();
2971 // Thumb2 support on iOS; ARM support on iOS, Linux and NaCl.
2972 bool UseFastISel = false;
2973 UseFastISel |= Subtarget->isTargetIOS() && !Subtarget->isThumb1Only();
2974 UseFastISel |= Subtarget->isTargetLinux() && !Subtarget->isThumb();
2975 UseFastISel |= Subtarget->isTargetNaCl() && !Subtarget->isThumb();
2976 if (UseFastISel) {
2977 // iOS always has a FP for backtracking, force other targets
2978 // to keep their FP when doing FastISel. The emitted code is
2979 // currently superior, and in cases like test-suite's lencod
2980 // FastISel isn't quite correct when FP is eliminated.
2981 TM.Options.NoFramePointerElim = true;
2968 if (Subtarget->isTargetIOS() && !Subtarget->isThumb1Only())
29822969 return new ARMFastISel(funcInfo, libInfo);
2983 }
29842970 return 0;
29852971 }
29862972 }
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
21 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-darwin | FileCheck %s --check-prefix=THUMB
32
43 %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
21 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
32
43 ; 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
21 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
32
43 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
21 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
32
43 ; 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
21 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
32 ; 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
53 ; 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
64 ; 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
85 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios -mattr=-vfp2 | FileCheck %s --check-prefix=THUMB-NOVFP
96
107 ; 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
21 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
32
43 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
21 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
32
43 ; 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
21
32 %union.anon = type { <16 x i32> }
43
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
21 ; rdar://9515076
32 ; (Make sure this doesn't crash.)
43
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
21 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-darwin | FileCheck %s --check-prefix=THUMB
32
43 @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: ldr r0, [r11]
48 ; LINUX-ARM: mov r0, r11
49 ; LINUX-ARM: ldr r0, [r0]
4950
5051 ; LINUX-THUMB2: frameaddr_index1:
5152 ; LINUX-THUMB2: str r7, [sp, #-4]!
7879 ; LINUX-ARM: frameaddr_index3:
7980 ; LINUX-ARM: push {r11}
8081 ; LINUX-ARM: mov r11, sp
81 ; LINUX-ARM: ldr r0, [r11]
82 ; LINUX-ARM: mov r0, r11
83 ; LINUX-ARM: ldr r0, [r0]
8284 ; LINUX-ARM: ldr r0, [r0]
8385 ; LINUX-ARM: ldr r0, [r0]
8486
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
21 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
32
43 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
21 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
32
43 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
21 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
32 ; 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
53 ; 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
64
75 ; Note that some of these tests assume that relocations are either
2119 ; ARM: uxtb r1, r1
2220 ; ARM: bl {{_?}}memset
2321 ; ARM-LONG: t1
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)?}}
22 ; ARM-LONG: movw r3, :lower16:L_memset$non_lazy_ptr
23 ; ARM-LONG: movt r3, :upper16:L_memset$non_lazy_ptr
2624 ; ARM-LONG: ldr r3, [r3]
2725 ; ARM-LONG: blx r3
2826 ; THUMB: t1
5957 ; ARM: ldr r1, [sp[[SLOT]]] @ 4-byte Reload
6058 ; ARM: bl {{_?}}memcpy
6159 ; ARM-LONG: t2
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)?}}
60 ; ARM-LONG: movw r3, :lower16:L_memcpy$non_lazy_ptr
61 ; ARM-LONG: movt r3, :upper16:L_memcpy$non_lazy_ptr
6462 ; ARM-LONG: ldr r3, [r3]
6563 ; ARM-LONG: blx r3
6664 ; THUMB: t2
9795 ; ARM: mov r0, r1
9896 ; ARM: bl {{_?}}memmove
9997 ; ARM-LONG: t3
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)?}}
98 ; ARM-LONG: movw r3, :lower16:L_memmove$non_lazy_ptr
99 ; ARM-LONG: movt r3, :upper16:L_memmove$non_lazy_ptr
102100 ; ARM-LONG: ldr r3, [r3]
103101 ; ARM-LONG: blx r3
104102 ; 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
21 ; rdar://10418009
32
43 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
21 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
32 ; rdar://10412592
43
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[[reg3]], r[[reg2]]]
28 ; ARMv7-ELF: ldr r[[reg2]], [r[[reg2]], r[[reg3]]]
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[[reg6]], r[[reg5]]]
57 ; ARMv7-ELF: ldr r[[reg5]], [r[[reg5]], r[[reg6]]]
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
21
32 define i32 @main() nounwind ssp {
43 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
21 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s
32
43 ; 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
21 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
32
43 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
21
32 define i32 @shl() nounwind ssp {
43 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
21 ; 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
42
53 define void @myadd(float* %sum, float* %addend) nounwind {
64 entry:
+0
-47
test/CodeGen/ARM/fast-isel-vararg.ll less more
None ; 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
21 ; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
32
43 ; Very basic fast-isel functionality.
None ; RUN: llc -fast-isel=false -asm-verbose -O0 -o %t < %s
0 ; RUN: llc -asm-verbose -O0 -o %t < %s
11 ; RUN: grep DW_AT_APPLE_omit_frame_ptr %t
22 ; RUN: llc -disable-fp-elim -asm-verbose -O0 -o %t < %s
33 ; RUN: grep -v DW_AT_APPLE_omit_frame_ptr %t