summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/dominator_test.cc
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2014-05-12 16:11:02 +0100
committerNicolas Geoffray <ngeoffray@google.com>2014-05-13 09:06:14 +0100
commit622d9c31febd950255b36a48b47e1f630197c5fe (patch)
tree8a7f14ce3c6c087955ad5fe91a3ce7d5b5a82461 /compiler/optimizing/dominator_test.cc
parent98a8a542f95e41c09d214a329a940b270f08f5b3 (diff)
downloadart-622d9c31febd950255b36a48b47e1f630197c5fe.zip
art-622d9c31febd950255b36a48b47e1f630197c5fe.tar.gz
art-622d9c31febd950255b36a48b47e1f630197c5fe.tar.bz2
Add loop recognition and CFG simplifications in new compiler.
We do three simplifications: - Split critical edges, for code generation from SSA (new). - Ensure one back edge per loop, to simplify loop recognition (new). - Ensure only one pre header for a loop, to simplify SSA creation (existing). Change-Id: I9bfccd4b236a00486a261078627b091c8a68be33
Diffstat (limited to 'compiler/optimizing/dominator_test.cc')
-rw-r--r--compiler/optimizing/dominator_test.cc17
1 files changed, 12 insertions, 5 deletions
diff --git a/compiler/optimizing/dominator_test.cc b/compiler/optimizing/dominator_test.cc
index 0417050..3062e37 100644
--- a/compiler/optimizing/dominator_test.cc
+++ b/compiler/optimizing/dominator_test.cc
@@ -167,7 +167,8 @@ TEST(OptimizerTest, CFG6) {
0,
1,
1,
- 3
+ 3,
+ 1, // Synthesized block to avoid critical edge.
};
TestCode(data, dominators, sizeof(dominators) / sizeof(int));
@@ -185,7 +186,9 @@ TEST(OptimizerTest, CFG7) {
0,
1,
1,
- -1 // exit block is not dominated by any block due to the spin loop.
+ -1, // exit block is not dominated by any block due to the spin loop.
+ 1, // block to avoid critical edge.
+ 1 // block to avoid critical edge.
};
TestCode(data, dominators, sizeof(dominators) / sizeof(int));
@@ -205,7 +208,8 @@ TEST(OptimizerTest, CFG8) {
1,
1,
1,
- -1 // exit block is not dominated by any block due to the spin loop.
+ -1, // exit block is not dominated by any block due to the spin loop.
+ 1 // block to avoid critical edge.
};
TestCode(data, dominators, sizeof(dominators) / sizeof(int));
@@ -225,7 +229,8 @@ TEST(OptimizerTest, CFG9) {
1,
1,
1,
- -1 // exit block is not dominated by any block due to the spin loop.
+ -1, // exit block is not dominated by any block due to the spin loop.
+ 1 // block to avoid critical edge.
};
TestCode(data, dominators, sizeof(dominators) / sizeof(int));
@@ -247,7 +252,9 @@ TEST(OptimizerTest, CFG10) {
2,
2,
1,
- 5 // Block number 5 dominates exit block
+ 5, // Block number 5 dominates exit block
+ 1, // block to avoid critical edge.
+ 2 // block to avoid critical edge.
};
TestCode(data, dominators, sizeof(dominators) / sizeof(int));