[PM] port Rewrite Statepoints For GC to the new pass manager.

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
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-1.ll b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-1.ll
index 54e9f41..bc8a863 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-1.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-1.ll
@@ -1,4 +1,5 @@
 ; 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 %merged_value base %merged_value.base
 
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-10.ll b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-10.ll
index 0479574..8aee4ed 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-10.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-10.ll
@@ -1,4 +1,5 @@
 ; 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
 
 
 declare i1 @runtime_value() "gc-leaf-function"
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-11.ll b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-11.ll
index 5149a29..ceb0946 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-11.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-11.ll
@@ -1,4 +1,5 @@
 ; 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
 
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-12.ll b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-12.ll
index 4706ce7..bf10769 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-12.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-12.ll
@@ -1,4 +1,5 @@
 ; 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 %select base null
 
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-13.ll b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-13.ll
index d01c771..ce502f9 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-13.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-13.ll
@@ -1,4 +1,5 @@
 ; 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
 
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-2.ll b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-2.ll
index f7676d2..c4ce644 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-2.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-2.ll
@@ -1,4 +1,5 @@
 ; 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 %merged_value base %base_obj
 
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-3.ll b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-3.ll
index 6f54f89..1eac5df 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-3.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-3.ll
@@ -1,4 +1,5 @@
 ; 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.i64 base %base_obj
 
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-4.ll b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-4.ll
index 5694cfd..b9f67c1 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-4.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-4.ll
@@ -1,4 +1,5 @@
 ; 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 %obj_to_consume base %obj_to_consume.base
 
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-5.ll b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-5.ll
index c1e3a36..990a252 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-5.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-5.ll
@@ -1,4 +1,5 @@
 ; 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 %merged_value base %merged_value.base
 
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-6.ll b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-6.ll
index 5db6d7a..267bc53 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-6.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-6.ll
@@ -1,4 +1,5 @@
 ; 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 %merged_value base %merged_value.base
 
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-7.ll b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-7.ll
index 930a838..173d7fd 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-7.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-7.ll
@@ -1,4 +1,5 @@
 ; 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 %merged_value base %merged_value.base
 
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-8.ll b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-8.ll
index 2f7fcd9..240ca74 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-8.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-8.ll
@@ -1,4 +1,5 @@
 ; 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_element_ptr base %array_obj
 
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-9.ll b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-9.ll
index bf49f69..8741a0c 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-9.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-9.ll
@@ -1,4 +1,5 @@
 ; 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
 
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers.ll b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers.ll
index e65897e..46a73c2 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/base-pointers.ll
@@ -1,4 +1,5 @@
 ; RUN: opt < %s -rewrite-statepoints-for-gc -S 2>&1 | FileCheck %s
+; RUN: opt < %s -passes=rewrite-statepoints-for-gc -S 2>&1 | FileCheck %s
 
 ; The rewriting needs to make %obj loop variant by inserting a phi 
 ; of the original value and it's relocation.
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/base-vector.ll b/llvm/test/Transforms/RewriteStatepointsForGC/base-vector.ll
index c34462f..d862b82 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/base-vector.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/base-vector.ll
@@ -1,4 +1,5 @@
 ; RUN: opt < %s -rewrite-statepoints-for-gc -S | FileCheck  %s
+; RUN: opt < %s -passes=rewrite-statepoints-for-gc -S | FileCheck  %s
 
 
 define i64 addrspace(1)* @test(<2 x i64 addrspace(1)*> %vec, i32 %idx) gc "statepoint-example" {
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/basic.ll b/llvm/test/Transforms/RewriteStatepointsForGC/basic.ll
index bb2210c..c1c160b 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/basic.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/basic.ll
@@ -1,4 +1,5 @@
 ; RUN: opt -S -rewrite-statepoints-for-gc < %s | FileCheck %s
+; RUN: opt -S -passes=rewrite-statepoints-for-gc < %s | FileCheck %s
 
 declare void @g()
 declare i32 @h()
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/basics.ll b/llvm/test/Transforms/RewriteStatepointsForGC/basics.ll
index 967a804..9b61107 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/basics.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/basics.ll
@@ -1,5 +1,6 @@
 ; This is a collection of really basic tests for gc.statepoint rewriting.
 ; RUN: opt < %s -rewrite-statepoints-for-gc -spp-rematerialization-threshold=0 -S | FileCheck %s
+; RUN: opt < %s -passes=rewrite-statepoints-for-gc -spp-rematerialization-threshold=0 -S | FileCheck %s
 
 ; Trivial relocation over a single call
 
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/call-gc-result.ll b/llvm/test/Transforms/RewriteStatepointsForGC/call-gc-result.ll
index 6fcd9b5..a38eb6f 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/call-gc-result.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/call-gc-result.ll
@@ -1,4 +1,5 @@
 ;; RUN: opt < %s -rewrite-statepoints-for-gc -S | FileCheck %s
+;; RUN: opt < %s -passes=rewrite-statepoints-for-gc -S | FileCheck %s
 
 ;; This test is to verify that gc_result from a call statepoint
 ;; can have preceding phis in its parent basic block. Unlike
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/codegen-cond.ll b/llvm/test/Transforms/RewriteStatepointsForGC/codegen-cond.ll
index 9e8cbaf..74fd5b9 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/codegen-cond.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/codegen-cond.ll
@@ -1,4 +1,5 @@
 ; RUN: opt -rewrite-statepoints-for-gc -S < %s | FileCheck %s
+; RUN: opt -passes=rewrite-statepoints-for-gc -S < %s | FileCheck %s
 
 ; A null test of a single value
 
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/constants.ll b/llvm/test/Transforms/RewriteStatepointsForGC/constants.ll
index 0a16f38..deaf3e7 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/constants.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/constants.ll
@@ -1,4 +1,5 @@
 ; RUN: opt -S -rewrite-statepoints-for-gc < %s | FileCheck %s
+; RUN: opt -S -passes=rewrite-statepoints-for-gc < %s | FileCheck %s
 
 ; constants don't get relocated.
 @G = addrspace(1) global i8 5
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/deopt-intrinsic-cconv.ll b/llvm/test/Transforms/RewriteStatepointsForGC/deopt-intrinsic-cconv.ll
index b74c196..86899d2 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/deopt-intrinsic-cconv.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/deopt-intrinsic-cconv.ll
@@ -1,4 +1,5 @@
 ; RUN: opt -rewrite-statepoints-for-gc -S < %s | FileCheck %s
+; RUN: opt -passes=rewrite-statepoints-for-gc -S < %s | FileCheck %s
 
 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-apple-macosx10.11.0"
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/deopt-intrinsic.ll b/llvm/test/Transforms/RewriteStatepointsForGC/deopt-intrinsic.ll
index ef0e2bd..78087e8 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/deopt-intrinsic.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/deopt-intrinsic.ll
@@ -1,4 +1,5 @@
 ; RUN: opt -rewrite-statepoints-for-gc -S < %s | FileCheck %s
+; RUN: opt -passes=rewrite-statepoints-for-gc -S < %s | FileCheck %s
 
 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-apple-macosx10.11.0"
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/deopt-lowering-attrs.ll b/llvm/test/Transforms/RewriteStatepointsForGC/deopt-lowering-attrs.ll
index bbf1071..d0a3319 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/deopt-lowering-attrs.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/deopt-lowering-attrs.ll
@@ -1,4 +1,5 @@
 ; RUN: opt -rewrite-statepoints-for-gc -S < %s | FileCheck %s
+; RUN: opt -passes=rewrite-statepoints-for-gc -S < %s | FileCheck %s
 ; Check that the "deopt-lowering" function attribute gets transcoded into
 ; flags on the resulting statepoint
 
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/deref-pointers.ll b/llvm/test/Transforms/RewriteStatepointsForGC/deref-pointers.ll
index 551da08..d08da73 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/deref-pointers.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/deref-pointers.ll
@@ -1,4 +1,5 @@
 ; RUN: opt -S -rewrite-statepoints-for-gc < %s | FileCheck %s
+; RUN: opt -S -passes=rewrite-statepoints-for-gc < %s | FileCheck %s
 
 ; CHECK: declare i8 addrspace(1)* @some_function_ret_deref()
 ; CHECK: define i8 addrspace(1)* @test_deref_arg(i8 addrspace(1)* %a)
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/drop-invalid-metadata.ll b/llvm/test/Transforms/RewriteStatepointsForGC/drop-invalid-metadata.ll
index ebc1586..f6a5e17 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/drop-invalid-metadata.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/drop-invalid-metadata.ll
@@ -1,4 +1,5 @@
 ; RUN: opt -S -rewrite-statepoints-for-gc < %s | FileCheck %s
+; RUN: opt -S -passes=rewrite-statepoints-for-gc < %s | FileCheck %s
 
 ; This test checks that metadata that's invalid after RS4GC is dropped. 
 ; We can miscompile if optimizations scheduled after RS4GC uses the
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/gc-relocate-creation.ll b/llvm/test/Transforms/RewriteStatepointsForGC/gc-relocate-creation.ll
index 714d739..644f5bd 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/gc-relocate-creation.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/gc-relocate-creation.ll
@@ -1,4 +1,5 @@
 ; RUN: opt < %s -rewrite-statepoints-for-gc -S | FileCheck %s
+; RUN: opt < %s -passes=rewrite-statepoints-for-gc -S | FileCheck %s
 
 ; This test is to verify gc.relocate can handle pointer to vector of
 ; pointers (<2 x i32 addrspace(1)*> addrspace(1)* in this case).
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/invokes.ll b/llvm/test/Transforms/RewriteStatepointsForGC/invokes.ll
index afcb6ad..d9ebd30 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/invokes.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/invokes.ll
@@ -1,4 +1,5 @@
 ; RUN: opt < %s -S -rewrite-statepoints-for-gc | FileCheck %s
+; RUN: opt < %s -S -passes=rewrite-statepoints-for-gc | FileCheck %s
 
 declare i64 addrspace(1)* @some_call(i64 addrspace(1)*)
 declare i32 @personality_function()
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/leaf-function.ll b/llvm/test/Transforms/RewriteStatepointsForGC/leaf-function.ll
index e2350d4..5de8515 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/leaf-function.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/leaf-function.ll
@@ -1,4 +1,5 @@
 ; RUN: opt < %s -S -rewrite-statepoints-for-gc | FileCheck %s
+; RUN: opt < %s -S -passes=rewrite-statepoints-for-gc | FileCheck %s
 
 declare void @foo() "gc-leaf-function"
 declare void @bar()
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/libcall.ll b/llvm/test/Transforms/RewriteStatepointsForGC/libcall.ll
index 4dbc9fe..cb54858 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/libcall.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/libcall.ll
@@ -2,6 +2,7 @@
 ; This test verifies that calls to libcalls functions do not get converted to
 ; statepoint calls.
 ; RUN: opt -S -rewrite-statepoints-for-gc < %s | FileCheck %s
+; RUN: opt -S -passes=rewrite-statepoints-for-gc < %s | FileCheck %s
 
 declare double @ldexp(double %x, i32 %n) nounwind readnone
 
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/live-vector-nosplit.ll b/llvm/test/Transforms/RewriteStatepointsForGC/live-vector-nosplit.ll
index cc0140a..3e63f01 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/live-vector-nosplit.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/live-vector-nosplit.ll
@@ -1,6 +1,7 @@
 ; Test that we can correctly handle vectors of pointers in statepoint 
 ; rewriting.  
 ; RUN: opt < %s -rewrite-statepoints-for-gc -S | FileCheck  %s
+; RUN: opt < %s -passes=rewrite-statepoints-for-gc -S | FileCheck  %s
 
 ; A non-vector relocation for comparison
 define i64 addrspace(1)* @test(i64 addrspace(1)* %obj) gc "statepoint-example" {
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/liveness-basics.ll b/llvm/test/Transforms/RewriteStatepointsForGC/liveness-basics.ll
index 9c848e5..457a5b2 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/liveness-basics.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/liveness-basics.ll
@@ -1,6 +1,7 @@
 ; A collection of liveness test cases to ensure we're reporting the
 ; correct live values at statepoints
 ; RUN: opt -rewrite-statepoints-for-gc -spp-rematerialization-threshold=0 -S < %s | FileCheck %s
+; RUN: opt -passes=rewrite-statepoints-for-gc -spp-rematerialization-threshold=0 -S < %s | FileCheck %s
 
 ; Tests to make sure we consider %obj live in both the taken and untaken 
 ; predeccessor of merge.
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/patchable-statepoints.ll b/llvm/test/Transforms/RewriteStatepointsForGC/patchable-statepoints.ll
index 924620a..63814ba 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/patchable-statepoints.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/patchable-statepoints.ll
@@ -1,4 +1,5 @@
 ; RUN: opt -S -rewrite-statepoints-for-gc < %s | FileCheck %s
+; RUN: opt -S -passes=rewrite-statepoints-for-gc < %s | FileCheck %s
 
 declare void @f()
 declare i32 @personality_function()
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/preprocess.ll b/llvm/test/Transforms/RewriteStatepointsForGC/preprocess.ll
index df42eb1..105e0e8 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/preprocess.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/preprocess.ll
@@ -1,4 +1,5 @@
 ; RUN: opt -rewrite-statepoints-for-gc -S < %s | FileCheck %s
+; RUN: opt -passes=rewrite-statepoints-for-gc -S < %s | FileCheck %s
 
 ; Test to make sure we destroy LCSSA's single entry phi nodes before
 ; running liveness
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/relocate-invoke-result.ll b/llvm/test/Transforms/RewriteStatepointsForGC/relocate-invoke-result.ll
index b96ec3e..d198b27 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/relocate-invoke-result.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/relocate-invoke-result.ll
@@ -1,5 +1,6 @@
 
 ;; RUN: opt -rewrite-statepoints-for-gc -verify -S < %s | FileCheck %s
+;; RUN: opt -passes=rewrite-statepoints-for-gc -verify -S < %s | FileCheck %s
 ;; This test is to verify that RewriteStatepointsForGC correctly relocates values
 ;; defined by invoke instruction results. 
 
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/relocation.ll b/llvm/test/Transforms/RewriteStatepointsForGC/relocation.ll
index eaa826c..daf4a79 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/relocation.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/relocation.ll
@@ -1,4 +1,5 @@
 ; RUN: opt < %s -rewrite-statepoints-for-gc -spp-rematerialization-threshold=0 -S | FileCheck %s
+; RUN: opt < %s -passes=rewrite-statepoints-for-gc -spp-rematerialization-threshold=0 -S | FileCheck %s
 
 
 declare void @foo()
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/rematerialize-derived-pointers.ll b/llvm/test/Transforms/RewriteStatepointsForGC/rematerialize-derived-pointers.ll
index 6372c9b..3f36b99 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/rematerialize-derived-pointers.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/rematerialize-derived-pointers.ll
@@ -1,4 +1,5 @@
 ; RUN: opt < %s -rewrite-statepoints-for-gc -S | FileCheck %s
+; RUN: opt < %s -passes=rewrite-statepoints-for-gc -S | FileCheck %s
 
 
 declare void @use_obj16(i16 addrspace(1)*) "gc-leaf-function"
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/rewrite-invoke.ll b/llvm/test/Transforms/RewriteStatepointsForGC/rewrite-invoke.ll
index 91d4fa3..f096f30 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/rewrite-invoke.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/rewrite-invoke.ll
@@ -1,4 +1,5 @@
 ; RUN: opt -rewrite-statepoints-for-gc -verify -S < %s | FileCheck %s
+; RUN: opt -passes=rewrite-statepoints-for-gc -verify -S < %s | FileCheck %s
 
 declare i8 addrspace(1)* @gc_call()
 
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/statepoint-attrs.ll b/llvm/test/Transforms/RewriteStatepointsForGC/statepoint-attrs.ll
index 38ad79e..4bebbc8 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/statepoint-attrs.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/statepoint-attrs.ll
@@ -1,4 +1,5 @@
 ; RUN: opt -S -rewrite-statepoints-for-gc < %s | FileCheck %s
+; RUN: opt -S -passes=rewrite-statepoints-for-gc < %s | FileCheck %s
 ; Ensure statepoints copy (valid) attributes from callsites.
 
 declare void @f(i8 addrspace(1)* %obj)
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/statepoint-calling-conventions.ll b/llvm/test/Transforms/RewriteStatepointsForGC/statepoint-calling-conventions.ll
index f40ff8f..bb2697e 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/statepoint-calling-conventions.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/statepoint-calling-conventions.ll
@@ -1,4 +1,5 @@
 ; RUN: opt -rewrite-statepoints-for-gc -S < %s | FileCheck %s
+; RUN: opt -passes=rewrite-statepoints-for-gc -S < %s | FileCheck %s
 
 ; Ensure that the gc.statepoint calls / invokes we generate carry over
 ; the right calling conventions.
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/statepoint-coreclr.ll b/llvm/test/Transforms/RewriteStatepointsForGC/statepoint-coreclr.ll
index a19196e..9f88c79 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/statepoint-coreclr.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/statepoint-coreclr.ll
@@ -1,4 +1,5 @@
 ; RUN: opt < %s -S -rewrite-statepoints-for-gc | FileCheck %s
+; RUN: opt < %s -S -passes=rewrite-statepoints-for-gc | FileCheck %s
 
 ; Basic test to make sure that safepoints are placed
 ; for CoreCLR GC
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/statepoint-format.ll b/llvm/test/Transforms/RewriteStatepointsForGC/statepoint-format.ll
index 029864e..3e42a79 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/statepoint-format.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/statepoint-format.ll
@@ -1,4 +1,5 @@
 ; RUN: opt -rewrite-statepoints-for-gc -S < %s | FileCheck %s
+; RUN: opt -passes=rewrite-statepoints-for-gc -S < %s | FileCheck %s
 
 ; Ensure that the gc.statepoint calls / invokes we generate have the
 ; set of arguments we expect it to have.
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/two-invokes-one-landingpad.ll b/llvm/test/Transforms/RewriteStatepointsForGC/two-invokes-one-landingpad.ll
index f35a366..caec746 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/two-invokes-one-landingpad.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/two-invokes-one-landingpad.ll
@@ -1,4 +1,5 @@
 ; RUN: opt < %s -rewrite-statepoints-for-gc -S | FileCheck %s
+; RUN: opt < %s -passes=rewrite-statepoints-for-gc -S | FileCheck %s
 
 declare void @some_call(i64 addrspace(1)*)
 
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/vector-bitcast.ll b/llvm/test/Transforms/RewriteStatepointsForGC/vector-bitcast.ll
index 981942a..74943fc 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/vector-bitcast.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/vector-bitcast.ll
@@ -1,4 +1,5 @@
 ; RUN: opt -S -rewrite-statepoints-for-gc < %s | FileCheck %s
+; RUN: opt -S -passes=rewrite-statepoints-for-gc < %s | FileCheck %s
 ;
 ; A test to make sure that we can look through bitcasts of
 ; vector types when a base pointer is contained in a vector.