summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/ARM/struct_byval.ll
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@google.com>2015-03-26 22:11:00 +0000
committerDerek Schuff <dschuff@google.com>2015-03-26 22:11:00 +0000
commitb051389f049bc195877077430a1300fd3fc75582 (patch)
treee951d43f583dfecd01ba30e0f7f66ec91eafe115 /llvm/test/CodeGen/ARM/struct_byval.ll
parent8f4d3ff1466a736d41e183c3275f634c129b9c09 (diff)
downloadbcm5719-llvm-b051389f049bc195877077430a1300fd3fc75582.tar.gz
bcm5719-llvm-b051389f049bc195877077430a1300fd3fc75582.zip
Use movw/movt instead of constant pool loads to lower byval parameter copies
Summary: The ARM backend can use a loop to implement copying byval parameters before a call. In non-thumb2 mode it uses a constant pool load to materialize the trip count. For targets that need movt instead (e.g. Native Client), use the same code as in thumb2 mode to materialize the trip count. Reviewers: jfb, t.p.northover Differential Revision: http://reviews.llvm.org/D8442 llvm-svn: 233324
Diffstat (limited to 'llvm/test/CodeGen/ARM/struct_byval.ll')
-rw-r--r--llvm/test/CodeGen/ARM/struct_byval.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/struct_byval.ll b/llvm/test/CodeGen/ARM/struct_byval.ll
index 8a04e4d82b2..d7b9b477ec1 100644
--- a/llvm/test/CodeGen/ARM/struct_byval.ll
+++ b/llvm/test/CodeGen/ARM/struct_byval.ll
@@ -1,5 +1,9 @@
; RUN: llc < %s -mtriple=armv7-apple-ios6.0 | FileCheck %s
; RUN: llc < %s -mtriple=thumbv7-apple-ios6.0 | FileCheck %s -check-prefix=THUMB
+; RUN: llc < %s -mtriple=armv7-unknown-nacl-gnueabi | FileCheck %s -check-prefix=NACL
+; RUN: llc < %s -mtriple=armv5-none-linux-gnueabi | FileCheck %s -check-prefix=NOMOVT
+
+; NOMOVT-NOT: movt
; rdar://9877866
%struct.SmallStruct = type { i32, [8 x i32], [37 x i8] }
@@ -33,6 +37,14 @@ entry:
; THUMB: sub
; THUMB: str
; THUMB: bne
+; NACL-LABEL: g:
+; Ensure that use movw instead of constpool for the loop trip count. But don't
+; match the __stack_chk_guard movw
+; NACL: movw r{{[1-9]}}, #
+; NACL: ldr
+; NACL: sub
+; NACL: str
+; NACL: bne
%st = alloca %struct.LargeStruct, align 4
%call = call i32 @e2(%struct.LargeStruct* byval %st)
ret i32 0
@@ -51,6 +63,11 @@ entry:
; THUMB: sub
; THUMB: vst1
; THUMB: bne
+; NACL: movw r{{[1-9]}}, #
+; NACL: vld1
+; NACL: sub
+; NACL: vst1
+; NACL: bne
%st = alloca %struct.LargeStruct, align 16
%call = call i32 @e3(%struct.LargeStruct* byval align 16 %st)
ret i32 0
OpenPOWER on IntegriCloud