[llvm] r259125 - [RS4GC] Port three tests to the deopt bundles directory
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 28 16:13:26 PST 2016
Author: sanjoy
Date: Thu Jan 28 18:13:26 2016
New Revision: 259125
URL: http://llvm.org/viewvc/llvm-project?rev=259125&view=rev
Log:
[RS4GC] Port three tests to the deopt bundles directory
two-invokes-one-landingpad.ll was only moved (and not "ported"), but
having everything in the `deopt-bundles` directory will make later
changes more obvious.
Added:
llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/base-pointers-12.ll
llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/base-pointers-13.ll
llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/two-invokes-one-landingpad.ll
Added: llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/base-pointers-12.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/base-pointers-12.ll?rev=259125&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/base-pointers-12.ll (added)
+++ llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/base-pointers-12.ll Thu Jan 28 18:13:26 2016
@@ -0,0 +1,20 @@
+; RUN: opt < %s -rs4gc-use-deopt-bundles -rewrite-statepoints-for-gc -spp-print-base-pointers -S 2>&1 | FileCheck %s
+
+; CHECK: derived %select base @global
+
+ at global = external addrspace(1) global i8
+
+define i8 @test(i1 %cond) gc "statepoint-example" {
+ %derived1 = getelementptr i8, i8 addrspace(1)* @global, i64 1
+ %derived2 = getelementptr i8, i8 addrspace(1)* @global, i64 2
+ %select = select i1 %cond, i8 addrspace(1)* %derived1, i8 addrspace(1)* %derived2
+ call void @extern()
+; CHECK-NOT: relocate
+; CHECK: %load = load i8, i8 addrspace(1)* %select
+ %load = load i8, i8 addrspace(1)* %select
+ ret i8 %load
+}
+
+declare void @extern() gc "statepoint-example"
+
+declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)
Added: llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/base-pointers-13.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/base-pointers-13.ll?rev=259125&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/base-pointers-13.ll (added)
+++ llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/base-pointers-13.ll Thu Jan 28 18:13:26 2016
@@ -0,0 +1,19 @@
+; RUN: opt < %s -rs4gc-use-deopt-bundles -rewrite-statepoints-for-gc -spp-print-base-pointers -S 2>&1 | FileCheck %s
+
+; CHECK: derived %derived base @global
+
+ at 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, ...)
Added: llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/two-invokes-one-landingpad.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/two-invokes-one-landingpad.ll?rev=259125&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/two-invokes-one-landingpad.ll (added)
+++ llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/two-invokes-one-landingpad.ll Thu Jan 28 18:13:26 2016
@@ -0,0 +1,33 @@
+; RUN: opt < %s -rewrite-statepoints-for-gc -rs4gc-use-deopt-bundles -S | FileCheck %s
+
+declare void @some_call(i64 addrspace(1)*)
+
+declare i32 @dummy_personality_function()
+
+define i64 addrspace(1)* @test(i64 addrspace(1)* %obj, i64 addrspace(1)* %obj1)
+ gc "statepoint-example"
+ personality i32 ()* @dummy_personality_function {
+entry:
+ invoke void @some_call(i64 addrspace(1)* %obj) [ "deopt"() ]
+ to label %second_invoke unwind label %exceptional_return
+
+second_invoke: ; preds = %entry
+ invoke void @some_call(i64 addrspace(1)* %obj) [ "deopt"() ]
+ to label %normal_return unwind label %exceptional_return
+
+normal_return: ; preds = %second_invoke
+ ret i64 addrspace(1)* %obj
+
+; CHECK: exceptional_return1:
+; CHECK-NEXT: %lpad2 = landingpad token
+
+; CHECK: exceptional_return.split-lp:
+; CHECK-NEXT: %lpad.split-lp = landingpad token
+
+; CHECK: exceptional_return:
+; CHECK-NOT: phi token
+
+exceptional_return: ; preds = %second_invoke, %entry
+ %lpad = landingpad token cleanup
+ ret i64 addrspace(1)* %obj1
+}
More information about the llvm-commits
mailing list