mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 17:32:19 +00:00
PR8921: LDM/POP do not support interworking prior to v5t.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122970 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
28f1015e36
commit
6819dbb6f8
@ -592,7 +592,7 @@ void ARMFrameInfo::emitPopInst(MachineBasicBlock &MBB,
|
|||||||
unsigned Reg = CSI[i-1].getReg();
|
unsigned Reg = CSI[i-1].getReg();
|
||||||
if (!(Func)(Reg, STI.isTargetDarwin())) continue;
|
if (!(Func)(Reg, STI.isTargetDarwin())) continue;
|
||||||
|
|
||||||
if (Reg == ARM::LR && !isVarArg) {
|
if (Reg == ARM::LR && !isVarArg && STI.hasV5TOps()) {
|
||||||
Reg = ARM::PC;
|
Reg = ARM::PC;
|
||||||
LdmOpc = AFI->isThumbFunction() ? ARM::t2LDMIA_RET : ARM::LDMIA_RET;
|
LdmOpc = AFI->isThumbFunction() ? ARM::t2LDMIA_RET : ARM::LDMIA_RET;
|
||||||
// Fold the return instruction into the LDM.
|
// Fold the return instruction into the LDM.
|
||||||
|
@ -1390,6 +1390,7 @@ bool ARMLoadStoreOpt::runOnMachineFunction(MachineFunction &Fn) {
|
|||||||
++MFI) {
|
++MFI) {
|
||||||
MachineBasicBlock &MBB = *MFI;
|
MachineBasicBlock &MBB = *MFI;
|
||||||
Modified |= LoadStoreMultipleOpti(MBB);
|
Modified |= LoadStoreMultipleOpti(MBB);
|
||||||
|
if (TM.getSubtarget<ARMSubtarget>().hasV5TOps())
|
||||||
Modified |= MergeReturnIntoLDM(MBB);
|
Modified |= MergeReturnIntoLDM(MBB);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
; RUN: llc < %s -mtriple=armv4-unknown-eabi | FileCheck %s
|
; RUN: llc < %s -mtriple=armv4-unknown-eabi | FileCheck %s -check-prefix=V4
|
||||||
; RUN: llc < %s -mtriple=armv5-unknown-eabi | FileCheck %s
|
; RUN: llc < %s -mtriple=armv5-unknown-eabi | FileCheck %s
|
||||||
; RUN: llc < %s -mtriple=armv6-unknown-eabi | FileCheck %s
|
; RUN: llc < %s -mtriple=armv6-unknown-eabi | FileCheck %s
|
||||||
|
|
||||||
@ -7,6 +7,8 @@ entry:
|
|||||||
%0 = tail call i32 @foo(i32 %a) nounwind ; <i32> [#uses=1]
|
%0 = tail call i32 @foo(i32 %a) nounwind ; <i32> [#uses=1]
|
||||||
%1 = add nsw i32 %0, 3 ; <i32> [#uses=1]
|
%1 = add nsw i32 %0, 3 ; <i32> [#uses=1]
|
||||||
; CHECK: ldmia sp!, {r11, pc}
|
; CHECK: ldmia sp!, {r11, pc}
|
||||||
|
; V4: pop
|
||||||
|
; V4-NEXT: mov pc, lr
|
||||||
ret i32 %1
|
ret i32 %1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
; RUN: llc < %s -march=arm
|
; RUN: llc < %s -mtriple=armv5t-apple-darwin | FileCheck %s
|
||||||
; RUN: llc < %s -march=arm | not grep bx
|
|
||||||
|
|
||||||
define void @test(i32 %Ptr, i8* %L) {
|
define void @test(i32 %Ptr, i8* %L) {
|
||||||
entry:
|
entry:
|
||||||
@ -24,6 +23,8 @@ bb1: ; preds = %bb, %entry
|
|||||||
br i1 %bothcond, label %bb, label %bb18
|
br i1 %bothcond, label %bb, label %bb18
|
||||||
|
|
||||||
bb18: ; preds = %bb1
|
bb18: ; preds = %bb1
|
||||||
|
; CHECK-NOT: bx
|
||||||
|
; CHECK: ldmia sp!
|
||||||
ret void
|
ret void
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
; RUN: llc < %s -march=arm -mtriple=arm-apple-darwin | \
|
; RUN: llc < %s -mtriple=armv7-apple-darwin | FileCheck %s
|
||||||
; RUN: grep cmpne | count 1
|
|
||||||
; RUN: llc < %s -march=arm -mtriple=arm-apple-darwin | \
|
|
||||||
; RUN: grep ldmiahi | count 1
|
|
||||||
|
|
||||||
define void @foo(i32 %X, i32 %Y) {
|
define void @foo(i32 %X, i32 %Y) {
|
||||||
entry:
|
entry:
|
||||||
|
; CHECK: cmpne
|
||||||
|
; CHECK: ldmiahi sp!
|
||||||
%tmp1 = icmp ult i32 %X, 4 ; <i1> [#uses=1]
|
%tmp1 = icmp ult i32 %X, 4 ; <i1> [#uses=1]
|
||||||
%tmp4 = icmp eq i32 %Y, 0 ; <i1> [#uses=1]
|
%tmp4 = icmp eq i32 %Y, 0 ; <i1> [#uses=1]
|
||||||
%tmp7 = or i1 %tmp4, %tmp1 ; <i1> [#uses=1]
|
%tmp7 = or i1 %tmp4, %tmp1 ; <i1> [#uses=1]
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
; RUN: llc < %s -march=arm -mtriple=arm-apple-darwin | \
|
; RUN: llc < %s -mtriple=armv7-apple-darwin | FileCheck %s
|
||||||
; RUN: grep cmpeq | count 1
|
|
||||||
; RUN: llc < %s -march=arm -mtriple=arm-apple-darwin | \
|
|
||||||
; RUN: grep moveq | count 1
|
|
||||||
; RUN: llc < %s -march=arm -mtriple=arm-apple-darwin | \
|
|
||||||
; RUN: grep ldmiaeq | count 1
|
|
||||||
; FIXME: Need post-ifcvt branch folding to get rid of the extra br at end of BB1.
|
; FIXME: Need post-ifcvt branch folding to get rid of the extra br at end of BB1.
|
||||||
|
|
||||||
%struct.quad_struct = type { i32, i32, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct* }
|
%struct.quad_struct = type { i32, i32, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct* }
|
||||||
|
|
||||||
define fastcc i32 @CountTree(%struct.quad_struct* %tree) {
|
define fastcc i32 @CountTree(%struct.quad_struct* %tree) {
|
||||||
|
; CHECK: cmpeq
|
||||||
|
; CHECK: moveq
|
||||||
|
; CHECK: ldmiaeq sp!
|
||||||
entry:
|
entry:
|
||||||
br label %tailrecurse
|
br label %tailrecurse
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
; RUN: llc < %s -march=arm -mtriple=arm-apple-darwin | \
|
; RUN: llc < %s -mtriple=armv7-apple-darwin | FileCheck %s
|
||||||
; RUN: grep ldmiane | count 1
|
|
||||||
|
|
||||||
%struct.SString = type { i8*, i32, i32 }
|
%struct.SString = type { i8*, i32, i32 }
|
||||||
|
|
||||||
declare void @abort()
|
declare void @abort()
|
||||||
|
|
||||||
define fastcc void @t(%struct.SString* %word, i8 signext %c) {
|
define fastcc void @t(%struct.SString* %word, i8 signext %c) {
|
||||||
|
; CHECK: ldmiane sp!
|
||||||
entry:
|
entry:
|
||||||
%tmp1 = icmp eq %struct.SString* %word, null ; <i1> [#uses=1]
|
%tmp1 = icmp eq %struct.SString* %word, null ; <i1> [#uses=1]
|
||||||
br i1 %tmp1, label %cond_true, label %cond_false
|
br i1 %tmp1, label %cond_true, label %cond_false
|
||||||
|
@ -1,10 +1,13 @@
|
|||||||
; RUN: llc < %s -mtriple=arm-apple-darwin | FileCheck %s
|
; RUN: llc < %s -mtriple=armv7-apple-darwin | FileCheck %s
|
||||||
|
; RUN: llc < %s -mtriple=armv4t-apple-darwin | FileCheck %s -check-prefix=V4T
|
||||||
|
|
||||||
@X = external global [0 x i32] ; <[0 x i32]*> [#uses=5]
|
@X = external global [0 x i32] ; <[0 x i32]*> [#uses=5]
|
||||||
|
|
||||||
define i32 @t1() {
|
define i32 @t1() {
|
||||||
; CHECK: t1:
|
; CHECK: t1:
|
||||||
; CHECK: ldmia
|
; CHECK: ldmia
|
||||||
|
; V4T: t1:
|
||||||
|
; V4T: ldmia
|
||||||
%tmp = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 0) ; <i32> [#uses=1]
|
%tmp = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 0) ; <i32> [#uses=1]
|
||||||
%tmp3 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 1) ; <i32> [#uses=1]
|
%tmp3 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 1) ; <i32> [#uses=1]
|
||||||
%tmp4 = tail call i32 @f1( i32 %tmp, i32 %tmp3 ) ; <i32> [#uses=1]
|
%tmp4 = tail call i32 @f1( i32 %tmp, i32 %tmp3 ) ; <i32> [#uses=1]
|
||||||
@ -14,6 +17,8 @@ define i32 @t1() {
|
|||||||
define i32 @t2() {
|
define i32 @t2() {
|
||||||
; CHECK: t2:
|
; CHECK: t2:
|
||||||
; CHECK: ldmia
|
; CHECK: ldmia
|
||||||
|
; V4T: t2:
|
||||||
|
; V4T: ldmia
|
||||||
%tmp = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 2) ; <i32> [#uses=1]
|
%tmp = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 2) ; <i32> [#uses=1]
|
||||||
%tmp3 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 3) ; <i32> [#uses=1]
|
%tmp3 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 3) ; <i32> [#uses=1]
|
||||||
%tmp5 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 4) ; <i32> [#uses=1]
|
%tmp5 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 4) ; <i32> [#uses=1]
|
||||||
@ -25,6 +30,10 @@ define i32 @t3() {
|
|||||||
; CHECK: t3:
|
; CHECK: t3:
|
||||||
; CHECK: ldmib
|
; CHECK: ldmib
|
||||||
; CHECK: ldmia sp!
|
; CHECK: ldmia sp!
|
||||||
|
; V4T: t3:
|
||||||
|
; V4T: ldmib
|
||||||
|
; V4T: pop
|
||||||
|
; V4T-NEXT: bx lr
|
||||||
%tmp = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 1) ; <i32> [#uses=1]
|
%tmp = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 1) ; <i32> [#uses=1]
|
||||||
%tmp3 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 2) ; <i32> [#uses=1]
|
%tmp3 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 2) ; <i32> [#uses=1]
|
||||||
%tmp5 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 3) ; <i32> [#uses=1]
|
%tmp5 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 3) ; <i32> [#uses=1]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
; RUN: llc < %s -stats |& grep {38.*Number of machine instrs printed}
|
; RUN: llc < %s -stats |& grep {39.*Number of machine instrs printed}
|
||||||
; RUN: llc < %s -stats |& not grep {.*Number of re-materialization}
|
; RUN: llc < %s -stats |& not grep {.*Number of re-materialization}
|
||||||
; This test really wants to check that the resultant "cond_true" block only
|
; This test really wants to check that the resultant "cond_true" block only
|
||||||
; has a single store in it, and that cond_true55 only has code to materialize
|
; has a single store in it, and that cond_true55 only has code to materialize
|
||||||
|
Loading…
x
Reference in New Issue
Block a user