[PATCH] statepoint-call-lowering: test relocate int and array
Ramkumar Ramachandra
artagnon at gmail.com
Wed Jan 14 18:09:05 PST 2015
Hi reames, sanjoy,
Let's confirm that this works before we attempt to relocate vectors.
http://reviews.llvm.org/D6989
Files:
test/CodeGen/X86/statepoint-call-lowering.ll
Index: test/CodeGen/X86/statepoint-call-lowering.ll
===================================================================
--- test/CodeGen/X86/statepoint-call-lowering.ll
+++ test/CodeGen/X86/statepoint-call-lowering.ll
@@ -75,6 +75,41 @@
ret i1 %call2
}
+define i32 @test_relocate_integer(i32* %i) {
+; CHECK-LABEL: test_relocate_integer
+; Check that relocation of an integer is lowered correctly
+; CHECK: pushq %rax
+; CHECK: callq return_i1
+; CHECK-NEXT: .Ltmp16:
+; CHECK-NEXT: movq (%rsp), %rax
+; CHECK-NEXT: movl (%rax), %eax
+; CHECK-NEXT: popq %rdx
+; CHECK-NEXT: retq
+entry:
+ %tok = tail call i32 (i1 ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, i32* %i)
+ %i-new = call i32* @llvm.experimental.gc.relocate.p0i32(i32 %tok, i32 4, i32 4)
+ %ret = load i32* %i-new
+ ret i32 %ret
+}
+
+define [3 x i32] @test_relocate_array([3 x i32]* %v) {
+; CHECK-LABEL: test_relocate_array
+; Check that relocation of an array of integers is lowered correctly
+; CHECK: pushq %rax
+; CHECK: callq return_i1
+; CHECK-NEXT: .Ltmp19:
+; CHECK-NEXT: movq (%rsp), %rcx
+; CHECK-NEXT: movl (%rcx), %eax
+; CHECK-NEXT: movl 4(%rcx), %edx
+; CHECK-NEXT: movl 8(%rcx), %ecx
+; CHECK-NEXT: popq %rsi
+; CHECK-NEXT: retq
+ %tok = call i32 (i1 ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, [3 x i32]* %v)
+ %v-new = call [3 x i32]* @llvm.experimental.gc.relocate.p0a3i32(i32 %tok, i32 4, i32 4)
+ %ret = load [3 x i32]* %v-new
+ ret [3 x i32] %ret
+}
+
declare i32 @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()*, i32, i32, ...)
declare i1 @llvm.experimental.gc.result.int.i1(i32)
@@ -88,3 +123,4 @@
declare float @llvm.experimental.gc.result.float.f32(i32)
declare i32* @llvm.experimental.gc.relocate.p0i32(i32, i32, i32)
+declare [3 x i32]* @llvm.experimental.gc.relocate.p0a3i32(i32, i32, i32)
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6989.18205.patch
Type: text/x-patch
Size: 1918 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150115/fbe4d0bf/attachment.bin>
More information about the llvm-commits
mailing list