summaryrefslogtreecommitdiff
path: root/compiler/optimizing/licm_test.cc
diff options
context:
space:
mode:
author David Brazdil <dbrazdil@google.com> 2015-11-06 01:36:20 +0000
committer David Brazdil <dbrazdil@google.com> 2015-11-09 10:27:08 +0000
commitdb51efb3617d15f1cd9e5ff0cc2d934777014e9a (patch)
treefa70acb9f8d090def2cae550db8c2e1f630f31c4 /compiler/optimizing/licm_test.cc
parent2649cba0fb7cdbd8fa60cb4f2fb320fb2b18ee37 (diff)
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/licm_test.cc')
-rw-r--r--compiler/optimizing/licm_test.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/optimizing/licm_test.cc b/compiler/optimizing/licm_test.cc
index 47457dec7d..2bb769a430 100644
--- a/compiler/optimizing/licm_test.cc
+++ b/compiler/optimizing/licm_test.cc
@@ -42,12 +42,14 @@ class LICMTest : public testing::Test {
loop_preheader_ = new (&allocator_) HBasicBlock(graph_);
loop_header_ = new (&allocator_) HBasicBlock(graph_);
loop_body_ = new (&allocator_) HBasicBlock(graph_);
+ return_ = new (&allocator_) HBasicBlock(graph_);
exit_ = new (&allocator_) HBasicBlock(graph_);
graph_->AddBlock(entry_);
graph_->AddBlock(loop_preheader_);
graph_->AddBlock(loop_header_);
graph_->AddBlock(loop_body_);
+ graph_->AddBlock(return_);
graph_->AddBlock(exit_);
graph_->SetEntryBlock(entry_);
@@ -57,8 +59,9 @@ class LICMTest : public testing::Test {
entry_->AddSuccessor(loop_preheader_);
loop_preheader_->AddSuccessor(loop_header_);
loop_header_->AddSuccessor(loop_body_);
- loop_header_->AddSuccessor(exit_);
+ loop_header_->AddSuccessor(return_);
loop_body_->AddSuccessor(loop_header_);
+ return_->AddSuccessor(exit_);
// Provide boiler-plate instructions.
parameter_ = new (&allocator_) HParameterValue(graph_->GetDexFile(), 0, 0, Primitive::kPrimNot);
@@ -89,6 +92,7 @@ class LICMTest : public testing::Test {
HBasicBlock* loop_preheader_;
HBasicBlock* loop_header_;
HBasicBlock* loop_body_;
+ HBasicBlock* return_;
HBasicBlock* exit_;
HInstruction* parameter_; // "this"