mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 12:43:36 +01:00
9146e8f676
Summary: The port is nearly straightforward. The only complication is related to the analyses handling, since one of the analyses used in this module pass is domtree, which is a function analysis. That requires asking for the results of each function and disallows a single interface for run-on-module pass action. Decided to copy-paste the main body of this pass. Most of its code is requesting analyses anyway, so not that much of a copy-paste. The rest of the code movement is to transform all the implementation helper functions like stripNonValidData into non-member statics. Extended all the related LLVM tests with new-pass-manager use. No failures. Reviewers: sanjoy, anna, reames Reviewed By: anna Subscribers: skatkov, llvm-commits Differential Revision: https://reviews.llvm.org/D41162 llvm-svn: 320796
22 lines
857 B
LLVM
22 lines
857 B
LLVM
; RUN: opt < %s -rewrite-statepoints-for-gc -spp-print-base-pointers -S 2>&1 | FileCheck %s
|
|
; RUN: opt < %s -passes=rewrite-statepoints-for-gc -spp-print-base-pointers -S 2>&1 | FileCheck %s
|
|
|
|
; CHECK: derived %next base %base_obj
|
|
|
|
declare i1 @runtime_value() "gc-leaf-function"
|
|
|
|
define void @maybe_GEP(i64 addrspace(1)* %base_obj) gc "statepoint-example" {
|
|
entry:
|
|
br label %loop
|
|
|
|
loop: ; preds = %loop, %entry
|
|
%current = phi i64 addrspace(1)* [ %base_obj, %entry ], [ %next, %loop ]
|
|
%condition = call i1 @runtime_value()
|
|
%maybe_next = getelementptr i64, i64 addrspace(1)* %current, i32 1
|
|
%next = select i1 %condition, i64 addrspace(1)* %maybe_next, i64 addrspace(1)* %current
|
|
call void @do_safepoint() [ "deopt"(i32 0, i32 -1, i32 0, i32 0, i32 0) ]
|
|
br label %loop
|
|
}
|
|
|
|
declare void @do_safepoint()
|