summaryrefslogtreecommitdiff
path: root/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
commit74af88a6661ad5185924bf39164fb4aa144d32cf (patch)
tree012664457d3b276810d160a295f18056c21f32f4 /test/CodeGen/X86/fast-isel-x86-64.ll
parent93b3eff62322803a520e183fdc294bffd6d99bfa (diff)
downloadllvm-74af88a6661ad5185924bf39164fb4aa144d32cf.tar.gz
llvm-74af88a6661ad5185924bf39164fb4aa144d32cf.tar.bz2
llvm-74af88a6661ad5185924bf39164fb4aa144d32cf.tar.xz
FastISel: avoid function calls between the materialization of the constant and its use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137993 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/fast-isel-x86-64.ll')
-rw-r--r--test/CodeGen/X86/fast-isel-x86-64.ll25
1 files changed, 24 insertions, 1 deletions
diff --git a/test/CodeGen/X86/fast-isel-x86-64.ll b/test/CodeGen/X86/fast-isel-x86-64.ll
index c4afc10ffa..6a5a10295f 100644
--- a/test/CodeGen/X86/fast-isel-x86-64.ll
+++ b/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)