diff options
| author | Tobias Grosser <grosser@fim.uni-passau.de> | 2010-07-22 07:46:31 +0000 |
|---|---|---|
| committer | Tobias Grosser <grosser@fim.uni-passau.de> | 2010-07-22 07:46:31 +0000 |
| commit | 336734aca6a7da385d674d6122728ad1ef6e1e57 (patch) | |
| tree | ff78916af8ab17944cccac336369efc2d2881b15 /llvm/test/Analysis/RegionInfo/cond_loop.ll | |
| parent | 3c31aa3a4412eceb7818f3b63910c3e1396c50e4 (diff) | |
| download | bcm5719-llvm-336734aca6a7da385d674d6122728ad1ef6e1e57.tar.gz bcm5719-llvm-336734aca6a7da385d674d6122728ad1ef6e1e57.zip | |
Add new RegionInfo pass.
The RegionInfo pass detects single entry single exit regions in a function,
where a region is defined as any subgraph that is connected to the remaining
graph at only two spots.
Furthermore an hierarchical region tree is built.
Use it by calling "opt -regions analyze" or "opt -view-regions".
llvm-svn: 109089
Diffstat (limited to 'llvm/test/Analysis/RegionInfo/cond_loop.ll')
| -rw-r--r-- | llvm/test/Analysis/RegionInfo/cond_loop.ll | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/llvm/test/Analysis/RegionInfo/cond_loop.ll b/llvm/test/Analysis/RegionInfo/cond_loop.ll new file mode 100644 index 00000000000..2ce57c3c5f3 --- /dev/null +++ b/llvm/test/Analysis/RegionInfo/cond_loop.ll @@ -0,0 +1,33 @@ +; RUN: opt -regions -analyze < %s | FileCheck %s +; RUN: opt -regions -stats < %s |& FileCheck -check-prefix=STAT %s +; RUN: opt -regions -print-region-style=bb -analyze < %s |& FileCheck -check-prefix=BBIT %s +; RUN: opt -regions -print-region-style=rn -analyze < %s |& FileCheck -check-prefix=RNIT %s + +define void @normal_condition() nounwind { +5: + br label %"0" + +0: + br label %"1" +1: + br i1 1, label %"2", label %"3" +2: + ret void +3: + br i1 1, label %"1", label %"4" +4: + br label %"0" +} + +; CHECK-NOT: => +; CHECK: [0] 5 => <Function Return> +; CHECK: [1] 0 => 2 + +; STAT: 2 region - The # of regions +; STAT: 1 region - The # of simple regions + +; BBIT: 5, 0, 1, 2, 3, 4, +; BBIT: 0, 1, 3, 4, + +; RNIT: 5, 0 => 2, 2, +; RNIT: 0, 1, 3, 4, |

