summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-11.ll
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2015-05-11 18:49:34 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2015-05-11 18:49:34 +0000
commit89c5491a72d2eda952f8314e6700e8657e13ffb6 (patch)
tree1ce36270d68aca3464a611392fb1247731002b0b /llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-11.ll
parent539175428883f84c4c8c8e6cc051a5d5b02fde88 (diff)
downloadbcm5719-llvm-89c5491a72d2eda952f8314e6700e8657e13ffb6.tar.gz
bcm5719-llvm-89c5491a72d2eda952f8314e6700e8657e13ffb6.zip
[RewriteStatepointsForGC] Fix a bug on creating gc_relocate for pointer to vector of pointers
Summary: In RewriteStatepointsForGC pass, we create a gc_relocate intrinsic for each relocated pointer, and the gc_relocate has the same type with the pointer. During the creation of gc_relocate intrinsic, llvm requires to mangle its type. However, llvm does not support mangling of all possible types. RewriteStatepointsForGC will hit an assertion failure when it tries to create a gc_relocate for pointer to vector of pointers because mangling for vector of pointers is not supported. This patch changes the way RewriteStatepointsForGC pass creates gc_relocate. For each relocated pointer, we erase the type of pointers and create an unified gc_relocate of type i8 addrspace(1)*. Then a bitcast is inserted to convert the gc_relocate to the correct type. In this way, gc_relocate does not need to deal with different types of pointers and the unsupported type mangling is no longer a problem. This change would also ease further merge when LLVM erases types of pointers and introduces an unified pointer type. Some minor changes are also introduced to gc_relocate related part in InstCombineCalls, CodeGenPrepare, and Verifier accordingly. Patch by Chen Li! Reviewers: reames, AndyAyers, sanjoy Reviewed By: sanjoy Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9592 llvm-svn: 237009
Diffstat (limited to 'llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-11.ll')
-rw-r--r--llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-11.ll4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-11.ll b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-11.ll
index 2fc9d42ee1f..11e252f43aa 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-11.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-11.ll
@@ -12,11 +12,11 @@ entry:
loop: ; preds = %loop, %entry
; CHECK-LABEL: loop:
; CHECK: phi i64 addrspace(1)*
-; CHECK-DAG: [ %base_obj.relocated, %loop ]
+; CHECK-DAG: [ %base_obj.relocated.casted, %loop ]
; CHECK-DAG: [ %base_obj, %entry ]
; CHECK: %current = phi i64 addrspace(1)*
; CHECK-DAG: [ %obj, %entry ]
-; CHECK-DAG: [ %next.relocated, %loop ]
+; CHECK-DAG: [ %next.relocated.casted, %loop ]
%current = phi i64 addrspace(1)* [ %obj, %entry ], [ %next, %loop ]
%next = getelementptr i64, i64 addrspace(1)* %current, i32 1
%safepoint_token = call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @do_safepoint, i32 0, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
OpenPOWER on IntegriCloud