summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/induction_var_analysis_test.cc
diff options
context:
space:
mode:
authorDavid Brazdil <dbrazdil@google.com>2015-11-06 01:36:20 +0000
committerDavid Brazdil <dbrazdil@google.com>2015-11-09 10:27:08 +0000
commitdb51efb3617d15f1cd9e5ff0cc2d934777014e9a (patch)
treefa70acb9f8d090def2cae550db8c2e1f630f31c4 /compiler/optimizing/induction_var_analysis_test.cc
parent2649cba0fb7cdbd8fa60cb4f2fb320fb2b18ee37 (diff)
downloadart-db51efb3617d15f1cd9e5ff0cc2d934777014e9a.tar.gz
art-db51efb3617d15f1cd9e5ff0cc2d934777014e9a.tar.bz2
art-db51efb3617d15f1cd9e5ff0cc2d934777014e9a.zip
ART: Fix critical edge splitting under try/catch
A critical edge would not be split if the predecessor ends with TryBoundary. This would eventually trip liveness analysis because a back edge block would have smaller liveness position than a nested loop. Another implication of this change is that an edge between a loop's pre-header ending with TryBoundary and the header will be split, guaranteeing that a pre-header always has just one successor. Bug: 25493695 Bug: 25454012 Change-Id: I5a13b8bb74509b48f5d628906f7158af007f99ae
Diffstat (limited to 'compiler/optimizing/induction_var_analysis_test.cc')
-rw-r--r--compiler/optimizing/induction_var_analysis_test.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/optimizing/induction_var_analysis_test.cc b/compiler/optimizing/induction_var_analysis_test.cc
index b7262f6b29..5de94f43c9 100644
--- a/compiler/optimizing/induction_var_analysis_test.cc
+++ b/compiler/optimizing/induction_var_analysis_test.cc
@@ -69,10 +69,13 @@ class InductionVarAnalysisTest : public testing::Test {
entry_ = new (&allocator_) HBasicBlock(graph_);
graph_->AddBlock(entry_);
BuildForLoop(0, n);
+ return_ = new (&allocator_) HBasicBlock(graph_);
+ graph_->AddBlock(return_);
exit_ = new (&allocator_) HBasicBlock(graph_);
graph_->AddBlock(exit_);
entry_->AddSuccessor(loop_preheader_[0]);
- loop_header_[0]->AddSuccessor(exit_);
+ loop_header_[0]->AddSuccessor(return_);
+ return_->AddSuccessor(exit_);
graph_->SetEntryBlock(entry_);
graph_->SetExitBlock(exit_);
@@ -91,6 +94,7 @@ class InductionVarAnalysisTest : public testing::Test {
entry_->AddInstruction(new (&allocator_) HStoreLocal(tmp_, constant100_));
dum_ = new (&allocator_) HLocal(n + 2);
entry_->AddInstruction(dum_);
+ return_->AddInstruction(new (&allocator_) HReturnVoid());
exit_->AddInstruction(new (&allocator_) HExit());
// Provide loop instructions.
@@ -177,6 +181,7 @@ class InductionVarAnalysisTest : public testing::Test {
// Fixed basic blocks and instructions.
HBasicBlock* entry_;
+ HBasicBlock* return_;
HBasicBlock* exit_;
HInstruction* parameter_; // "this"
HInstruction* constant0_;