
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
21 lines
716 B
LLVM
21 lines
716 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 %derived base null
|
|
|
|
@global = external addrspace(1) global i8
|
|
|
|
define i8 @test(i64 %offset) gc "statepoint-example" {
|
|
%derived = getelementptr i8, i8 addrspace(1)* @global, i64 %offset
|
|
call void @extern()
|
|
; CHECK-NOT: relocate
|
|
; CHECK-NOT: remat
|
|
; CHECK: %load = load i8, i8 addrspace(1)* %derived
|
|
%load = load i8, i8 addrspace(1)* %derived
|
|
ret i8 %load
|
|
}
|
|
|
|
declare void @extern() gc "statepoint-example"
|
|
|
|
declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)
|