summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.cc
diff options
context:
space:
mode:
author Santiago Aboy Solanes <solanes@google.com> 2023-10-13 14:21:30 +0100
committer Santiago Aboy Solanes <solanes@google.com> 2023-10-16 09:38:31 +0000
commita5ab063a82b7d4d5e120e5d81899a731397e186a (patch)
tree1e7df1e6331e4986443abf6ba349fdfc64262f74 /compiler/optimizing/nodes.cc
parent754bdc0a8caf6c05f091afd674759bf7a54a4289 (diff)
Add a new helper RecomputeDominatorTree
It clears loop and dominance information, and builds the dominator tree. It also dchecks that we are not calling this methods with irreducible loops, as it is not supported. When adding this helper we found a partial LSE bug as it was recomputing dominator tree for irreducible loops. Test: art/test/testrunner/testrunner.py --host --64 -b --optimizing Bug: 304749506 Change-Id: Ia4cc72cd19779ad881fa686e52b43679fe5a64d3
Diffstat (limited to 'compiler/optimizing/nodes.cc')
-rw-r--r--compiler/optimizing/nodes.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc
index 5795ea7ca9..53ed49a307 100644
--- a/compiler/optimizing/nodes.cc
+++ b/compiler/optimizing/nodes.cc
@@ -255,6 +255,14 @@ GraphAnalysisResult HGraph::BuildDominatorTree() {
return kAnalysisSuccess;
}
+GraphAnalysisResult HGraph::RecomputeDominatorTree() {
+ DCHECK(!HasIrreducibleLoops()) << "Recomputing loop information in graphs with irreducible loops "
+ << "is unsupported, as it could lead to loop header changes";
+ ClearLoopInformation();
+ ClearDominanceInformation();
+ return BuildDominatorTree();
+}
+
void HGraph::ClearDominanceInformation() {
for (HBasicBlock* block : GetActiveBlocks()) {
block->ClearDominanceInformation();
@@ -3001,12 +3009,7 @@ HInstruction* HGraph::InlineInto(HGraph* outer_graph, HInvoke* invoke) {
}
}
if (rerun_loop_analysis) {
- DCHECK(!outer_graph->HasIrreducibleLoops())
- << "Recomputing loop information in graphs with irreducible loops "
- << "is unsupported, as it could lead to loop header changes";
- outer_graph->ClearLoopInformation();
- outer_graph->ClearDominanceInformation();
- outer_graph->BuildDominatorTree();
+ outer_graph->RecomputeDominatorTree();
} else if (rerun_dominance) {
outer_graph->ClearDominanceInformation();
outer_graph->ComputeDominanceInformation();