2016-01-29 08:28:57 +08:00
|
|
|
; RUN: opt < %s -rewrite-statepoints-for-gc -spp-print-base-pointers -S 2>&1 | FileCheck %s
|
2015-02-28 08:20:48 +08:00
|
|
|
|
|
|
|
; 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-12 02:49:34 +08:00
|
|
|
; CHECK-DAG: [ %base_obj.relocated.casted, %loop ]
|
2015-02-28 08:20:48 +08: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-12 02:49:34 +08:00
|
|
|
; CHECK-DAG: [ %next.relocated.casted, %loop ]
|
2015-02-28 08:20:48 +08:00
|
|
|
%current = phi i64 addrspace(1)* [ %obj, %entry ], [ %next, %loop ]
|
|
|
|
%next = getelementptr i64, i64 addrspace(1)* %current, i32 1
|
2016-01-29 08:28:57 +08:00
|
|
|
call void @do_safepoint() [ "deopt"(i32 0, i32 -1, i32 0, i32 0, i32 0) ]
|
2015-02-28 08:20:48 +08:00
|
|
|
br label %loop
|
|
|
|
}
|