summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/fast-isel-x86-64.ll
diff options
context:
space:
mode:
authorIvan Krasin <krasin@chromium.org>2011-08-18 22:06:10 +0000
committerIvan Krasin <krasin@chromium.org>2011-08-18 22:06:10 +0000
commitd7cbd4c518a38594b12c6d1c9b0c7e8eed1c40c7 (patch)
treeddda557b51d3591c9806fc8fd516ad48d567ea40 /llvm/test/CodeGen/X86/fast-isel-x86-64.ll
parentf6cb9bcf557dd5638e05d6fe36e944159f7bb720 (diff)
downloadbcm5719-llvm-d7cbd4c518a38594b12c6d1c9b0c7e8eed1c40c7.tar.gz
bcm5719-llvm-d7cbd4c518a38594b12c6d1c9b0c7e8eed1c40c7.zip
FastISel: avoid function calls between the materialization of the constant and its use.
llvm-svn: 137993
Diffstat (limited to 'llvm/test/CodeGen/X86/fast-isel-x86-64.ll')
-rw-r--r--llvm/test/CodeGen/X86/fast-isel-x86-64.ll25
1 files changed, 24 insertions, 1 deletions
diff --git a/llvm/test/CodeGen/X86/fast-isel-x86-64.ll b/llvm/test/CodeGen/X86/fast-isel-x86-64.ll
index c4afc10ffab..6a5a10295fb 100644
--- a/llvm/test/CodeGen/X86/fast-isel-x86-64.ll
+++ b/llvm/test/CodeGen/X86/fast-isel-x86-64.ll
@@ -259,4 +259,27 @@ define void @test21(double* %p1) {
; CHECK: test21:
; CHECK-NOT: pxor
; CHECK: movsd LCPI
-} \ No newline at end of file
+}
+
+; Check that immediate arguments to a function
+; do not cause massive spilling and are used
+; as immediates just before the call.
+define void @test22() nounwind {
+entry:
+ call void @foo22(i32 0)
+ call void @foo22(i32 1)
+ call void @foo22(i32 2)
+ call void @foo22(i32 3)
+ ret void
+; CHECK: test22:
+; CHECK: movl $0, %edi
+; CHECK: callq _foo22
+; CHECK: movl $1, %edi
+; CHECK: callq _foo22
+; CHECK: movl $2, %edi
+; CHECK: callq _foo22
+; CHECK: movl $3, %edi
+; CHECK: callq _foo22
+}
+
+declare void @foo22(i32)
OpenPOWER on IntegriCloud