summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/AArch64
diff options
context:
space:
mode:
authorJessica Paquette <jpaquette@apple.com>2018-04-12 16:16:18 +0000
committerJessica Paquette <jpaquette@apple.com>2018-04-12 16:16:18 +0000
commit8aa6cd5cb99901219ac7461b1c74784179007913 (patch)
treef1b20f0a9c2b0de0b30637b928c6d7486a072051 /llvm/test/CodeGen/AArch64
parent12e2afd2fa960277636b0951890e3f8dbcb532b8 (diff)
downloadbcm5719-llvm-8aa6cd5cb99901219ac7461b1c74784179007913.tar.gz
bcm5719-llvm-8aa6cd5cb99901219ac7461b1c74784179007913.zip
[AArch64] Move AFI->setRedZone(false) to top of emitPrologue
AFI->setRedZone(false) was put in the wrong place before, and so it only fired on functions that didn't have stack frames. This moves that to the top of emitPrologue to make sure that every function without a redzone has it set correctly. This also adds a function representing one of the early exit cases (GHC calling convention) to the MachineOutliner noredzone test to ensure that we can outline from functions like these, where we never use a redzone. llvm-svn: 329922
Diffstat (limited to 'llvm/test/CodeGen/AArch64')
-rw-r--r--llvm/test/CodeGen/AArch64/machine-outliner-noredzone.ll40
1 files changed, 35 insertions, 5 deletions
diff --git a/llvm/test/CodeGen/AArch64/machine-outliner-noredzone.ll b/llvm/test/CodeGen/AArch64/machine-outliner-noredzone.ll
index 504f8a8802b..f0246057f65 100644
--- a/llvm/test/CodeGen/AArch64/machine-outliner-noredzone.ll
+++ b/llvm/test/CodeGen/AArch64/machine-outliner-noredzone.ll
@@ -1,14 +1,44 @@
; RUN: llc -enable-machine-outliner %s -o - | FileCheck %s
-; CHECK: OUTLINED_FUNCTION
; RUN: llc -enable-machine-outliner -aarch64-redzone %s -o - | FileCheck %s -check-prefix=REDZONE
-; REDZONE-NOT: OUTLINED_FUNCTION
+; Ensure that the MachineOutliner does not fire on functions which use a
+; redzone. We don't care about what's actually outlined here. We just want to
+; force behaviour in the outliner to make sure that it never acts on anything
+; that might have a redzone.
target triple = "arm64----"
-; Ensure that the MachineOutliner does not fire on functions which use a
-; redzone. foo() should have a redzone when compiled with -aarch64-redzone, and
-; no redzone otherwise.
+@x = common global i32 0, align 4
+declare void @baz() #0
+
+; In AArch64FrameLowering, there are a couple special early exit cases where we
+; *know* we don't use a redzone. The GHC calling convention is one of these
+; cases. Make sure that we know we don't have a redzone even in these cases.
+define cc 10 void @bar() #0 {
+ ; CHECK-LABEL: bar
+ ; CHECK: bl OUTLINED_FUNCTION
+ ; REDZONE-LABEL: bar
+ ; REDZONE: bl OUTLINED_FUNCTION
+ %1 = load i32, i32* @x, align 4
+ %2 = add nsw i32 %1, 1
+ store i32 %2, i32* @x, align 4
+ call void @baz()
+ %3 = load i32, i32* @x, align 4
+ %4 = add nsw i32 %3, 1
+ store i32 %4, i32* @x, align 4
+ call void @baz()
+ %5 = load i32, i32* @x, align 4
+ %6 = add nsw i32 %5, 1
+ store i32 %6, i32* @x, align 4
+ ret void
+}
+
+; foo() should have a redzone when compiled with -aarch64-redzone, and no
+; redzone otherwise.
define void @foo() #0 {
+ ; CHECK-LABEL: foo
+ ; CHECK: bl OUTLINED_FUNCTION
+ ; REDZONE-LABEL: foo
+ ; REDZONE-NOT: bl OUTLINED_FUNCTION
%1 = alloca i32, align 4
%2 = alloca i32, align 4
%3 = alloca i32, align 4
OpenPOWER on IntegriCloud