1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/test/Transforms/RewriteStatepointsForGC/base-pointers-9.ll
Eric Christopher a62270de2c Revert "Temporarily Revert "Add basic loop fusion pass.""
The reversion apparently deleted the test/Transforms directory.

Will be re-reverting again.

llvm-svn: 358552
2019-04-17 04:52:47 +00:00

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()