2015-02-28 01:20:48 +01:00
|
|
|
; RUN: opt %s -rewrite-statepoints-for-gc -spp-print-base-pointers -S 2>&1 | FileCheck %s
|
|
|
|
|
|
|
|
; CHECK: derived %next base %base_obj
|
|
|
|
|
|
|
|
declare void @do_safepoint()
|
|
|
|
|
|
|
|
define void @test(i64 addrspace(1)* %base_obj) gc "statepoint-example" {
|
|
|
|
entry:
|
|
|
|
%obj = getelementptr i64, i64 addrspace(1)* %base_obj, i32 1
|
|
|
|
br label %loop
|
|
|
|
|
|
|
|
loop: ; preds = %loop, %entry
|
|
|
|
; CHECK-LABEL: loop:
|
|
|
|
; CHECK: phi i64 addrspace(1)*
|
[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
2015-05-11 20:49:34 +02:00
|
|
|
; CHECK-DAG: [ %base_obj.relocated.casted, %loop ]
|
2015-02-28 01:20:48 +01:00
|
|
|
; CHECK-DAG: [ %base_obj, %entry ]
|
|
|
|
; CHECK: %current = phi i64 addrspace(1)*
|
|
|
|
; CHECK-DAG: [ %obj, %entry ]
|
[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
2015-05-11 20:49:34 +02:00
|
|
|
; CHECK-DAG: [ %next.relocated.casted, %loop ]
|
2015-02-28 01:20:48 +01:00
|
|
|
%current = phi i64 addrspace(1)* [ %obj, %entry ], [ %next, %loop ]
|
|
|
|
%next = getelementptr i64, i64 addrspace(1)* %current, i32 1
|
2015-12-26 08:54:32 +01:00
|
|
|
%safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @do_safepoint, i32 0, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
|
2015-02-28 01:20:48 +01:00
|
|
|
br label %loop
|
|
|
|
}
|
|
|
|
|
2015-12-26 08:54:32 +01:00
|
|
|
declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)
|