Introduce RegionInfoAnalysis, which compute Region Tree in the new PassManager. NFC

Differential Revision: http://reviews.llvm.org/D17571

llvm-svn: 261904
diff --git a/llvm/test/Analysis/RegionInfo/20100809_bb_not_in_domtree.ll b/llvm/test/Analysis/RegionInfo/20100809_bb_not_in_domtree.ll
index 0dfa0bf..84e7278 100644
--- a/llvm/test/Analysis/RegionInfo/20100809_bb_not_in_domtree.ll
+++ b/llvm/test/Analysis/RegionInfo/20100809_bb_not_in_domtree.ll
@@ -1,4 +1,6 @@
 ; RUN: opt -regions < %s
+; RUN: opt < %s -passes='print<regions>'
+
 define i32 @main() nounwind {
 entry:
   br label %for.cond
diff --git a/llvm/test/Analysis/RegionInfo/block_sort.ll b/llvm/test/Analysis/RegionInfo/block_sort.ll
index d7ef79c..ce1a481 100644
--- a/llvm/test/Analysis/RegionInfo/block_sort.ll
+++ b/llvm/test/Analysis/RegionInfo/block_sort.ll
@@ -4,6 +4,8 @@
 ; RUN: opt -regions -print-region-style=bb  -analyze < %s 2>&1 | FileCheck -check-prefix=BBIT %s
 ; RUN: opt -regions -print-region-style=rn  -analyze < %s 2>&1 | FileCheck -check-prefix=RNIT %s
 
+; RUN: opt < %s -passes='print<regions>' 2>&1 | FileCheck %s
+
 define void @BZ2_blockSort() nounwind {
 start:
   br label %while
diff --git a/llvm/test/Analysis/RegionInfo/cond_loop.ll b/llvm/test/Analysis/RegionInfo/cond_loop.ll
index 0da4e5d..333cdff 100644
--- a/llvm/test/Analysis/RegionInfo/cond_loop.ll
+++ b/llvm/test/Analysis/RegionInfo/cond_loop.ll
@@ -4,6 +4,8 @@
 ; RUN: opt -regions -print-region-style=bb  -analyze < %s 2>&1 | FileCheck -check-prefix=BBIT %s
 ; RUN: opt -regions -print-region-style=rn  -analyze < %s 2>&1 | FileCheck -check-prefix=RNIT %s
 
+; RUN: opt < %s -passes='print<regions>' 2>&1 | FileCheck %s
+
 define void @normal_condition() nounwind {
 5:
         br label %"0"
diff --git a/llvm/test/Analysis/RegionInfo/condition_complicated.ll b/llvm/test/Analysis/RegionInfo/condition_complicated.ll
index 53f13c1..ba107bf 100644
--- a/llvm/test/Analysis/RegionInfo/condition_complicated.ll
+++ b/llvm/test/Analysis/RegionInfo/condition_complicated.ll
@@ -4,6 +4,8 @@
 ; RUN: opt -regions -print-region-style=bb  -analyze < %s 2>&1 | FileCheck -check-prefix=BBIT %s
 ; RUN: opt -regions -print-region-style=rn  -analyze < %s 2>&1 | FileCheck -check-prefix=RNIT %s
 
+; RUN: opt < %s -passes='print<regions>' 2>&1 | FileCheck %s
+
 define internal fastcc zeroext i8 @handle_compress() nounwind {
 end165:
   br i1 1, label %false239, label %true181
diff --git a/llvm/test/Analysis/RegionInfo/condition_complicated_2.ll b/llvm/test/Analysis/RegionInfo/condition_complicated_2.ll
index fd04afc..9071771 100644
--- a/llvm/test/Analysis/RegionInfo/condition_complicated_2.ll
+++ b/llvm/test/Analysis/RegionInfo/condition_complicated_2.ll
@@ -4,6 +4,8 @@
 ; RUN: opt -regions -print-region-style=bb  -analyze < %s 2>&1 | FileCheck -check-prefix=BBIT %s
 ; RUN: opt -regions -print-region-style=rn  -analyze < %s 2>&1 | FileCheck -check-prefix=RNIT %s
 
+; RUN: opt < %s -passes='print<regions>' 2>&1 | FileCheck %s
+
 define internal fastcc void @compress() nounwind {
 end33:
   br i1 1, label %end124, label %lor.lhs.false95
diff --git a/llvm/test/Analysis/RegionInfo/condition_forward_edge.ll b/llvm/test/Analysis/RegionInfo/condition_forward_edge.ll
index 88c45c2..9c1ac75 100644
--- a/llvm/test/Analysis/RegionInfo/condition_forward_edge.ll
+++ b/llvm/test/Analysis/RegionInfo/condition_forward_edge.ll
@@ -4,6 +4,8 @@
 ; RUN: opt -regions -print-region-style=bb  -analyze < %s 2>&1 | FileCheck -check-prefix=BBIT %s
 ; RUN: opt -regions -print-region-style=rn  -analyze < %s 2>&1 | FileCheck -check-prefix=RNIT %s
 
+; RUN: opt < %s -passes='print<regions>' 2>&1 | FileCheck %s
+
 define void @normal_condition() nounwind {
 0:
 	br label %"1"
diff --git a/llvm/test/Analysis/RegionInfo/condition_same_exit.ll b/llvm/test/Analysis/RegionInfo/condition_same_exit.ll
index bfb0df8..570c772 100644
--- a/llvm/test/Analysis/RegionInfo/condition_same_exit.ll
+++ b/llvm/test/Analysis/RegionInfo/condition_same_exit.ll
@@ -4,6 +4,8 @@
 ; RUN: opt -regions -print-region-style=bb  -analyze < %s 2>&1 | FileCheck -check-prefix=BBIT %s
 ; RUN: opt -regions -print-region-style=rn  -analyze < %s 2>&1 | FileCheck -check-prefix=RNIT %s
 
+; RUN: opt < %s -passes='print<regions>' 2>&1 | FileCheck %s
+
 define void @normal_condition() nounwind {
 0:
 	br i1 1, label %"1", label %"4"
diff --git a/llvm/test/Analysis/RegionInfo/condition_simple.ll b/llvm/test/Analysis/RegionInfo/condition_simple.ll
index 3f93a6e..46c1b94 100644
--- a/llvm/test/Analysis/RegionInfo/condition_simple.ll
+++ b/llvm/test/Analysis/RegionInfo/condition_simple.ll
@@ -4,6 +4,8 @@
 ; RUN: opt -regions -print-region-style=bb  -analyze < %s 2>&1 | FileCheck -check-prefix=BBIT %s
 ; RUN: opt -regions -print-region-style=rn  -analyze < %s 2>&1 | FileCheck -check-prefix=RNIT %s
 
+; RUN: opt < %s -passes='print<regions>' 2>&1 | FileCheck %s
+
 define void @normal_condition() nounwind {
 0:
 	br label %"1"
diff --git a/llvm/test/Analysis/RegionInfo/exit_in_condition.ll b/llvm/test/Analysis/RegionInfo/exit_in_condition.ll
index ac409ec..4eb3be4 100644
--- a/llvm/test/Analysis/RegionInfo/exit_in_condition.ll
+++ b/llvm/test/Analysis/RegionInfo/exit_in_condition.ll
@@ -4,6 +4,8 @@
 ; RUN: opt -regions -print-region-style=bb  -analyze < %s 2>&1 | FileCheck -check-prefix=BBIT %s
 ; RUN: opt -regions -print-region-style=rn  -analyze < %s 2>&1 | FileCheck -check-prefix=RNIT %s
 
+; RUN: opt < %s -passes='print<regions>' 2>&1 | FileCheck %s
+
 define internal fastcc zeroext i8 @handle_compress() nounwind {
 entry:
   br label %outer
diff --git a/llvm/test/Analysis/RegionInfo/loop_with_condition.ll b/llvm/test/Analysis/RegionInfo/loop_with_condition.ll
index 4c1c8654..4122b20 100644
--- a/llvm/test/Analysis/RegionInfo/loop_with_condition.ll
+++ b/llvm/test/Analysis/RegionInfo/loop_with_condition.ll
@@ -5,6 +5,8 @@
 ; RUN: opt -regions -print-region-style=bb  -analyze < %s 2>&1 | FileCheck -check-prefix=BBIT %s
 ; RUN: opt -regions -print-region-style=rn  -analyze < %s 2>&1 | FileCheck -check-prefix=RNIT %s
 
+; RUN: opt < %s -passes='print<regions>' 2>&1 | FileCheck %s
+
 define void @normal_condition() nounwind {
 0:
         br label %"1"
diff --git a/llvm/test/Analysis/RegionInfo/loops_1.ll b/llvm/test/Analysis/RegionInfo/loops_1.ll
index 9efe619..aedb484 100644
--- a/llvm/test/Analysis/RegionInfo/loops_1.ll
+++ b/llvm/test/Analysis/RegionInfo/loops_1.ll
@@ -4,6 +4,8 @@
 ; RUN: opt -regions -print-region-style=bb  -analyze < %s 2>&1 | FileCheck -check-prefix=BBIT %s
 ; RUN: opt -regions -print-region-style=rn  -analyze < %s 2>&1 | FileCheck -check-prefix=RNIT %s
 
+; RUN: opt < %s -passes='print<regions>' 2>&1 | FileCheck %s
+
 define internal fastcc zeroext i8 @loops_1() nounwind {
 entry:
   br i1 1, label %outer , label %a
diff --git a/llvm/test/Analysis/RegionInfo/loops_2.ll b/llvm/test/Analysis/RegionInfo/loops_2.ll
index ca7eca7..3ac83b0 100644
--- a/llvm/test/Analysis/RegionInfo/loops_2.ll
+++ b/llvm/test/Analysis/RegionInfo/loops_2.ll
@@ -4,6 +4,8 @@
 ; RUN: opt -regions -print-region-style=bb  -analyze < %s 2>&1 | FileCheck -check-prefix=BBIT %s
 ; RUN: opt -regions -print-region-style=rn  -analyze < %s 2>&1 | FileCheck -check-prefix=RNIT %s
 
+; RUN: opt < %s -passes='print<regions>' 2>&1 | FileCheck %s
+
 define void @meread_() nounwind {
 entry:
   br label %bb23
diff --git a/llvm/test/Analysis/RegionInfo/mix_1.ll b/llvm/test/Analysis/RegionInfo/mix_1.ll
index 55001c7..3ae22af 100644
--- a/llvm/test/Analysis/RegionInfo/mix_1.ll
+++ b/llvm/test/Analysis/RegionInfo/mix_1.ll
@@ -5,6 +5,8 @@
 ; RUN: opt -regions -print-region-style=bb  -analyze < %s 2>&1 | FileCheck -check-prefix=BBIT %s
 ; RUN: opt -regions -print-region-style=rn  -analyze < %s 2>&1 | FileCheck -check-prefix=RNIT %s
 
+; RUN: opt < %s -passes='print<regions>' 2>&1 | FileCheck %s
+
 define void @a_linear_impl_fig_1() nounwind {
 0:
 
diff --git a/llvm/test/Analysis/RegionInfo/nested_loops.ll b/llvm/test/Analysis/RegionInfo/nested_loops.ll
index 3e73b3a..6db3237 100644
--- a/llvm/test/Analysis/RegionInfo/nested_loops.ll
+++ b/llvm/test/Analysis/RegionInfo/nested_loops.ll
@@ -5,6 +5,8 @@
 ; RUN: opt -regions -print-region-style=bb  -analyze < %s 2>&1 | FileCheck -check-prefix=BBIT %s
 ; RUN: opt -regions -print-region-style=rn  -analyze < %s 2>&1 | FileCheck -check-prefix=RNIT %s
 
+; RUN: opt < %s -passes='print<regions>' 2>&1 | FileCheck %s
+
 define internal fastcc zeroext i8 @handle_compress() nounwind {
 entry:
   br label %outer
diff --git a/llvm/test/Analysis/RegionInfo/next.ll b/llvm/test/Analysis/RegionInfo/next.ll
index b22bbcc..617273f 100644
--- a/llvm/test/Analysis/RegionInfo/next.ll
+++ b/llvm/test/Analysis/RegionInfo/next.ll
@@ -4,6 +4,8 @@
 ; RUN: opt -regions -print-region-style=bb  -analyze < %s 2>&1 | FileCheck -check-prefix=BBIT %s
 ; RUN: opt -regions -print-region-style=rn  -analyze < %s 2>&1 | FileCheck -check-prefix=RNIT %s
 
+; RUN: opt < %s -passes='print<regions>' 2>&1 | FileCheck %s
+
 define void @MAIN__() nounwind {
 entry:
   br label %__label_002001.outer
diff --git a/llvm/test/Analysis/RegionInfo/paper.ll b/llvm/test/Analysis/RegionInfo/paper.ll
index 0398d2b..3e592f4 100644
--- a/llvm/test/Analysis/RegionInfo/paper.ll
+++ b/llvm/test/Analysis/RegionInfo/paper.ll
@@ -4,6 +4,8 @@
 ; RUN: opt -regions -print-region-style=bb  -analyze < %s 2>&1 | FileCheck -check-prefix=BBIT %s
 ; RUN: opt -regions -print-region-style=rn  -analyze < %s 2>&1 | FileCheck -check-prefix=RNIT %s
 
+; RUN: opt < %s -passes='print<regions>' 2>&1 | FileCheck %s
+
 define void @a_linear_impl_fig_1() nounwind {
 0:
         br label %"1"
diff --git a/llvm/test/Analysis/RegionInfo/two_loops_same_header.ll b/llvm/test/Analysis/RegionInfo/two_loops_same_header.ll
index 2571342..2d5fa08 100644
--- a/llvm/test/Analysis/RegionInfo/two_loops_same_header.ll
+++ b/llvm/test/Analysis/RegionInfo/two_loops_same_header.ll
@@ -4,6 +4,8 @@
 ; RUN: opt -regions -print-region-style=bb  -analyze < %s 2>&1 | FileCheck -check-prefix=BBIT %s
 ; RUN: opt -regions -print-region-style=rn  -analyze < %s 2>&1 | FileCheck -check-prefix=RNIT %s
 
+; RUN: opt < %s -passes='print<regions>' 2>&1 | FileCheck %s
+
 define internal fastcc zeroext i8 @handle_compress() nounwind {
 entry:
   br label %outer
diff --git a/llvm/test/Analysis/RegionInfo/unreachable_bb.ll b/llvm/test/Analysis/RegionInfo/unreachable_bb.ll
index 626ccbe..5dd1be9 100644
--- a/llvm/test/Analysis/RegionInfo/unreachable_bb.ll
+++ b/llvm/test/Analysis/RegionInfo/unreachable_bb.ll
@@ -1,4 +1,5 @@
 ; RUN: opt -regions -analyze < %s | FileCheck %s
+; RUN: opt < %s -passes='print<regions>' 2>&1 | FileCheck %s
 
 ; We should not crash if there are some bbs that are not reachable.
 define void @f() {