summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorWeiming Zhao <weimingz@codeaurora.org>2014-03-20 23:28:16 +0000
committerWeiming Zhao <weimingz@codeaurora.org>2014-03-20 23:28:16 +0000
commit4eb2d228e9c676eea67c4a74090f76efa1a058fb (patch)
treea83a3d977f54bc69c819ad26058361561e45ec23 /test
parentaff0ab4e7ca5ee5e65b5b25fad8f6a17f364e072 (diff)
downloadllvm-4eb2d228e9c676eea67c4a74090f76efa1a058fb.tar.gz
llvm-4eb2d228e9c676eea67c4a74090f76efa1a058fb.tar.bz2
llvm-4eb2d228e9c676eea67c4a74090f76efa1a058fb.tar.xz
Fix PR19136: [ARM] Fix Folding SP Update into vpush/vpop
Sicne MBB->computeRegisterLivenes() returns Dead for sub regs like s0, d0 is used in vpop instead of updating sp, which causes s0 dead before its use. This patch checks the liveness of each subreg to make sure the reg is actually dead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204411 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/ARM/fold-stack-adjust.ll31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/fold-stack-adjust.ll b/test/CodeGen/ARM/fold-stack-adjust.ll
index feac793f4f..695a20b597 100644
--- a/test/CodeGen/ARM/fold-stack-adjust.ll
+++ b/test/CodeGen/ARM/fold-stack-adjust.ll
@@ -1,6 +1,7 @@
; RUN: llc -mtriple=thumbv7-apple-none-macho < %s | FileCheck %s
; RUN: llc -mtriple=thumbv6m-apple-none-macho -disable-fp-elim < %s | FileCheck %s --check-prefix=CHECK-T1
; RUN: llc -mtriple=thumbv7-apple-darwin-ios -disable-fp-elim < %s | FileCheck %s --check-prefix=CHECK-IOS
+; RUN: llc -mtriple=thumbv7--linux-gnueabi -disable-fp-elim < %s | FileCheck %s --check-prefix=CHECK-LINUX
declare void @bar(i8*)
@@ -185,3 +186,33 @@ define void @test_varsize(...) minsize {
call void @bar(i8* %var)
ret void
}
+
+%"MyClass" = type { i8*, i32, i32, float, float, float, [2 x i8], i32, i32* }
+
+declare float @foo()
+
+declare void @bar3()
+
+declare %"MyClass"* @bar2(%"MyClass"* returned, i16*, i32, float, float, i32, i32, i1 zeroext, i1 zeroext, i32)
+
+define fastcc float @check_vfp_no_return_clobber2(i16* %r, i16* %chars, i32 %length, i1 zeroext %flag) minsize {
+entry:
+; CHECK-LINUX-LABEL: check_vfp_no_return_clobber2
+; CHECK-LINUX: vpush {d0, d1, d2, d3, d4, d5, d6, d7, d8}
+; CHECK-NOT: sub sp,
+; ...
+; CHECK-LINUX: add sp
+; CHECK-LINUX: vpop {d8}
+ %run = alloca %"MyClass", align 4
+ %call = call %"MyClass"* @bar2(%"MyClass"* %run, i16* %chars, i32 %length, float 0.000000e+00, float 0.000000e+00, i32 1, i32 1, i1 zeroext false, i1 zeroext true, i32 3)
+ %call1 = call float @foo()
+ %cmp = icmp eq %"MyClass"* %run, null
+ br i1 %cmp, label %exit, label %if.then
+
+if.then: ; preds = %entry
+ call void @bar3()
+ br label %exit
+
+exit: ; preds = %if.then, %entry
+ ret float %call1
+}