diff options
| author | 2015-04-29 16:51:50 +0000 | |
|---|---|---|
| committer | 2015-04-29 16:51:50 +0000 | |
| commit | c1849c58ce2a35c37f19e75038e034df47815ecd (patch) | |
| tree | 4fc7867085ad15daa8e6e5eeef7077a74517917c /compiler/optimizing/nodes.cc | |
| parent | 4c176ef5ecd5a28354b9f98e5bafb848b0399a63 (diff) | |
| parent | 0430fc9216dddf6a6967cfffd37dfa99d73c2c68 (diff) | |
am 0430fc92: Merge "ART: Fix loop information after dead code elimination"
* commit '0430fc9216dddf6a6967cfffd37dfa99d73c2c68':
ART: Fix loop information after dead code elimination
Diffstat (limited to 'compiler/optimizing/nodes.cc')
| -rw-r--r-- | compiler/optimizing/nodes.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc index 699987c05e..f07f4c7590 100644 --- a/compiler/optimizing/nodes.cc +++ b/compiler/optimizing/nodes.cc @@ -376,7 +376,6 @@ bool HLoopInformation::Populate() { } HBasicBlock* HLoopInformation::GetPreHeader() const { - DCHECK_EQ(header_->GetPredecessors().Size(), 2u); return header_->GetDominator(); } @@ -1038,6 +1037,20 @@ void HBasicBlock::DisconnectAndDelete() { SetGraph(nullptr); } +void HBasicBlock::UpdateLoopInformation() { + // Check if loop information points to a dismantled loop. If so, replace with + // the loop information of a larger loop which contains this block, or nullptr + // otherwise. We iterate in case the larger loop has been destroyed too. + while (IsInLoop() && loop_information_->GetBackEdges().IsEmpty()) { + if (IsLoopHeader()) { + HSuspendCheck* suspend_check = loop_information_->GetSuspendCheck(); + DCHECK_EQ(suspend_check->GetBlock(), this); + RemoveInstruction(suspend_check); + } + loop_information_ = loop_information_->GetPreHeader()->GetLoopInformation(); + } +} + void HBasicBlock::MergeWith(HBasicBlock* other) { DCHECK_EQ(GetGraph(), other->GetGraph()); DCHECK(GetDominatedBlocks().Contains(other)); |