mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-27 13:30:05 +00:00
fe532ad6d6
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
48 lines
1.7 KiB
LLVM
48 lines
1.7 KiB
LLVM
; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios | FileCheck %s --check-prefix=ARM
|
|
; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-linux-gnueabi | FileCheck %s --check-prefix=ARM
|
|
; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
|
|
|
|
define i32 @VarArg() nounwind {
|
|
entry:
|
|
%i = alloca i32, align 4
|
|
%j = alloca i32, align 4
|
|
%k = alloca i32, align 4
|
|
%m = alloca i32, align 4
|
|
%n = alloca i32, align 4
|
|
%tmp = alloca i32, align 4
|
|
%0 = load i32* %i, align 4
|
|
%1 = load i32* %j, align 4
|
|
%2 = load i32* %k, align 4
|
|
%3 = load i32* %m, align 4
|
|
%4 = load i32* %n, align 4
|
|
; ARM: VarArg
|
|
; ARM: mov [[FP:r[0-9]+]], sp
|
|
; ARM: sub sp, sp, #32
|
|
; ARM: movw r0, #5
|
|
; ARM: ldr r1, {{\[}}[[FP]], #-4]
|
|
; ARM: ldr r2, {{\[}}[[FP]], #-8]
|
|
; ARM: ldr r3, {{\[}}[[FP]], #-12]
|
|
; ARM: ldr [[Ra:r[0-9]+]], [sp, #16]
|
|
; ARM: ldr [[Rb:[lr]+[0-9]*]], [sp, #12]
|
|
; ARM: str [[Ra]], [sp]
|
|
; ARM: str [[Rb]], [sp, #4]
|
|
; ARM: bl {{_?CallVariadic}}
|
|
; THUMB: sub sp, #32
|
|
; THUMB: movs r0, #5
|
|
; THUMB: movt r0, #0
|
|
; THUMB: ldr r1, [sp, #28]
|
|
; THUMB: ldr r2, [sp, #24]
|
|
; THUMB: ldr r3, [sp, #20]
|
|
; THUMB: ldr.w {{[a-z0-9]+}}, [sp, #16]
|
|
; THUMB: ldr.w {{[a-z0-9]+}}, [sp, #12]
|
|
; THUMB: str.w {{[a-z0-9]+}}, [sp]
|
|
; THUMB: str.w {{[a-z0-9]+}}, [sp, #4]
|
|
; THUMB: bl {{_?}}CallVariadic
|
|
%call = call i32 (i32, ...)* @CallVariadic(i32 5, i32 %0, i32 %1, i32 %2, i32 %3, i32 %4)
|
|
store i32 %call, i32* %tmp, align 4
|
|
%5 = load i32* %tmp, align 4
|
|
ret i32 %5
|
|
}
|
|
|
|
declare i32 @CallVariadic(i32, ...)
|