summaryrefslogtreecommitdiff
path: root/compiler/optimizing/execution_subgraph.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2021-09-13 14:15:26 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2021-09-13 14:15:26 +0000
commit1683d19a4c6791847aac9cde42b647a03f42942c (patch)
tree51fcf85a576098dd865da4f03b52835d092a14d9 /compiler/optimizing/execution_subgraph.cc
parent26f7cfa5b088e9789a5e14afa726b9f401f9989c (diff)
parent9c70cdb384578e5c37b828cf4f629c929d743d1f (diff)
Partial LSE: handle all kinds of infinite loops. am: 9c70cdb384
Original change: https://googleplex-android-review.googlesource.com/c/platform/art/+/15750021 Change-Id: I2544e0e0fe68ae02c42ab6f2bf0a85aa807b9c0f
Diffstat (limited to 'compiler/optimizing/execution_subgraph.cc')
-rw-r--r--compiler/optimizing/execution_subgraph.cc13
1 files changed, 5 insertions, 8 deletions
diff --git a/compiler/optimizing/execution_subgraph.cc b/compiler/optimizing/execution_subgraph.cc
index 6d105668c0..66fdfcda5b 100644
--- a/compiler/optimizing/execution_subgraph.cc
+++ b/compiler/optimizing/execution_subgraph.cc
@@ -86,12 +86,6 @@ void ExecutionSubgraph::Prune() {
ScopedArenaVector<std::bitset<kMaxFilterableSuccessors>> results(
graph_->GetBlocks().size(), temporaries.Adapter(kArenaAllocLSA));
unreachable_blocks_.ClearAllBits();
- // TODO We should support infinite loops as well.
- if (UNLIKELY(graph_->GetExitBlock() == nullptr)) {
- // Infinite loop
- valid_ = false;
- return;
- }
// Fills up the 'results' map with what we need to add to update
// allowed_successors in order to prune sink nodes.
bool start_reaches_end = false;
@@ -170,8 +164,11 @@ void ExecutionSubgraph::Prune() {
<< "current path size: " << current_path.size()
<< " cur_block id: " << cur_block->GetBlockId() << " entry id "
<< graph_->GetEntryBlock()->GetBlockId();
- DCHECK(!visiting.IsBitSet(id))
- << "Somehow ended up in a loop! This should have been caught before now! " << id;
+ if (visiting.IsBitSet(id)) {
+ // TODO We should support infinite loops as well.
+ start_reaches_end = false;
+ break;
+ }
std::bitset<kMaxFilterableSuccessors>& result = results[id];
if (cur_block == graph_->GetExitBlock()) {
start_reaches_end = true;