summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/AArch64
diff options
context:
space:
mode:
authorJessica Paquette <jpaquette@apple.com>2018-11-30 21:14:58 +0000
committerJessica Paquette <jpaquette@apple.com>2018-11-30 21:14:58 +0000
commit1cb18ec4ece5539f83ad2d79777f77b5cbc9d669 (patch)
treec06773824a1f7d56bc4050603ce1c4ca08356bc2 /llvm/test/CodeGen/AArch64
parent35fcc294ab5fbfd9bdaa053261d80bc0dd2d7701 (diff)
downloadbcm5719-llvm-1cb18ec4ece5539f83ad2d79777f77b5cbc9d669.tar.gz
bcm5719-llvm-1cb18ec4ece5539f83ad2d79777f77b5cbc9d669.zip
[MachineOutliner] Outline both register save calls + no LR save calls together
Instead of treating the outlined functions for these as distinct frames, they should be combined into one case. Neither allows for stack fixups, and both generate the same frame. Thus, they ought to be considered one case. This makes the code far easier to understand, for one thing. It also offers some small code size improvements. It's fairly rare to see a class of outlined functions that doesn't fall entirely into one variant (on CTMark anyway). It does happen from time to time though. This mostly offers some serious simplification. Also update the test to show the added functionality. llvm-svn: 348036
Diffstat (limited to 'llvm/test/CodeGen/AArch64')
-rw-r--r--llvm/test/CodeGen/AArch64/machine-outliner-regsave.mir36
1 files changed, 26 insertions, 10 deletions
diff --git a/llvm/test/CodeGen/AArch64/machine-outliner-regsave.mir b/llvm/test/CodeGen/AArch64/machine-outliner-regsave.mir
index 6d00bd39cde..d05cbddbb32 100644
--- a/llvm/test/CodeGen/AArch64/machine-outliner-regsave.mir
+++ b/llvm/test/CodeGen/AArch64/machine-outliner-regsave.mir
@@ -2,8 +2,8 @@
# RUN: -run-pass=machine-outliner -verify-machineinstrs %s -o - | FileCheck %s
# Check that we save LR to a callee-saved register when possible.
# foo() should use a callee-saved register. However, bar() should not.
---- |
-
+--- |
+
define void @foo() #0 {
ret void
}
@@ -17,33 +17,40 @@
---
# Make sure that when we outline and a register is available, we
# use it to save + restore LR instead of SP.
+# Also make sure that we can call functions that require no save as the same
+# outlined function.
# CHECK: name: foo
-# CHECK-DAG: bb.0
+# CHECK-DAG: bb.1
# CHECK-DAG: $x[[REG:[0-9]+]] = ORRXrs $xzr, $lr, 0
# CHECK-NEXT: BL
# CHECK-NEXT: $lr = ORRXrs $xzr, $x[[REG]], 0
-# CHECK-DAG: bb.1
+# CHECK-DAG: bb.2
# CHECK-DAG: $x[[REG]] = ORRXrs $xzr, $lr, 0
# CHECK-NEXT: BL
# CHECK-NEXT: $lr = ORRXrs $xzr, $x[[REG]], 0
-# CHECK-DAG: bb.2
+# CHECK-DAG: bb.3
# CHECK-DAG: $x[[REG]] = ORRXrs $xzr, $lr, 0
# CHECK-NEXT: BL
# CHECK-NEXT: $lr = ORRXrs $xzr, $x[[REG]], 0
+# CHECK-DAG: bb.4
+# CHECK-NOT: $x[[REG]] = ORRXrs $xzr, $lr, 0
+# CHECK-DAG: BL
name: foo
tracksRegLiveness: true
-fixedStack:
+fixedStack:
body: |
bb.0:
- liveins: $lr, $w9
$x25 = ORRXri $xzr, 1
+ $lr = ORRXri $xzr, 1
+ bb.1:
+ liveins: $lr, $w9
$w9 = ORRWri $wzr, 1
$w9 = ORRWri $wzr, 1
$w9 = ORRWri $wzr, 1
$w9 = ORRWri $wzr, 1
$w9 = ORRWri $wzr, 1
$w9 = ORRWri $wzr, 2
- bb.1:
+ bb.2:
liveins: $lr, $w9
$w9 = ORRWri $wzr, 1
$w9 = ORRWri $wzr, 1
@@ -51,7 +58,15 @@ body: |
$w9 = ORRWri $wzr, 1
$w9 = ORRWri $wzr, 1
$w9 = ORRWri $wzr, 2
- bb.2:
+ bb.3:
+ liveins: $lr, $w9
+ $w9 = ORRWri $wzr, 1
+ $w9 = ORRWri $wzr, 1
+ $w9 = ORRWri $wzr, 1
+ $w9 = ORRWri $wzr, 1
+ $w9 = ORRWri $wzr, 1
+ $w9 = ORRWri $wzr, 2
+ bb.4:
liveins: $lr, $w9
$w9 = ORRWri $wzr, 1
$w9 = ORRWri $wzr, 1
@@ -59,6 +74,8 @@ body: |
$w9 = ORRWri $wzr, 1
$w9 = ORRWri $wzr, 1
$w9 = ORRWri $wzr, 2
+ bb.5:
+ liveins: $w9
RET undef $lr
...
@@ -109,4 +126,3 @@ body: |
bb.3:
liveins: $lr, $x0, $x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8, $x9, $x10, $x11, $x12, $x13, $x14, $x15, $x19, $x20, $x21, $x22, $x23, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28
RET undef $lr
-
OpenPOWER on IntegriCloud