summaryrefslogtreecommitdiff
path: root/test/CodeGen/AArch64
diff options
context:
space:
mode:
authorJessica Paquette <jpaquette@apple.com>2017-12-09 00:43:49 +0000
committerJessica Paquette <jpaquette@apple.com>2017-12-09 00:43:49 +0000
commitce39caef81ecf0369ae4fa382c6f40c7409a08b4 (patch)
tree12cf16ffcc74a127efa0921020f7d59090a23181 /test/CodeGen/AArch64
parent45db4ee0fc2be6272020a21a1eb90b8078ecc7d3 (diff)
[MachineOutliner] Outline calls
The outliner previously would never outline calls. Calls are pretty common in files, so it makes sense to outline them. In fact, in the LLVM test suite, if you count the number of instructions that the outliner misses when you outline calls vs when you don't, it turns out that, on average, around 6% of the instructions encountered are calls. So, if we outline calls, we can find more candidates, and thus save some more space. This commit adds that functionality and updates the mir test to reflect that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320229 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/AArch64')
-rw-r--r--test/CodeGen/AArch64/machine-outliner.mir16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CodeGen/AArch64/machine-outliner.mir b/test/CodeGen/AArch64/machine-outliner.mir
index ee3daf11c9f..708e2e42880 100644
--- a/test/CodeGen/AArch64/machine-outliner.mir
+++ b/test/CodeGen/AArch64/machine-outliner.mir
@@ -1,6 +1,10 @@
# RUN: llc -mtriple=aarch64--- -run-pass=machine-outliner %s -o - | FileCheck %s
--- |
+ define void @baz() #0 {
+ ret void
+ }
+
define i32 @main() #0 {
ret i32 0
}
@@ -80,6 +84,7 @@ body: |
---
# This test ensures that we can avoid saving LR when it's available.
# CHECK-LABEL: bb.1:
+# CHECK-NOT: BL @baz, implicit-def dead %lr, implicit %sp
# CHECK: BL @OUTLINED_FUNCTION_[[F1:[0-9]+]], implicit-def %lr, implicit %sp
# CHECK-NEXT: %w17 = ORRWri %wzr, 2
# CHECK-NEXT: BL @OUTLINED_FUNCTION_[[F1]], implicit-def %lr, implicit %sp
@@ -93,15 +98,19 @@ body: |
%fp = frame-setup ADDXri %sp, 16, 0
bb.1:
+ BL @baz, implicit-def dead %lr, implicit %sp
%w17 = ORRWri %wzr, 1
%w17 = ORRWri %wzr, 1
%w17 = ORRWri %wzr, 1
%w17 = ORRWri %wzr, 1
+ BL @baz, implicit-def dead %lr, implicit %sp
%w17 = ORRWri %wzr, 2
+ BL @baz, implicit-def dead %lr, implicit %sp
%w17 = ORRWri %wzr, 1
%w17 = ORRWri %wzr, 1
%w17 = ORRWri %wzr, 1
%w17 = ORRWri %wzr, 1
+ BL @baz, implicit-def dead %lr, implicit %sp
%w8 = ORRWri %wzr, 0
bb.2:
@@ -110,6 +119,13 @@ body: |
RET undef %lr
...
+---
+name: baz
+tracksRegLiveness: true
+body: |
+ bb.0:
+ liveins: %w0, %lr, %w8
+ RET undef %lr
# CHECK-LABEL: name: OUTLINED_FUNCTION_{{[0-9]}}
# CHECK=LABEL: name: OUTLINED_FUNCTION_{{[1-9]}}