summaryrefslogtreecommitdiff
path: root/compiler/optimizing/execution_subgraph.cc
diff options
context:
space:
mode:
authorEric Arseneau <earseneau@google.com>2021-12-19 22:49:18 -0800
committerEric Arseneau <earseneau@google.com>2021-12-19 22:49:18 -0800
commit0c5adfaaa09b234ea4a11a28b931c91c3d68f423 (patch)
treee60b0a64a2b342e96f6b886ec3e2e453e494e567 /compiler/optimizing/execution_subgraph.cc
parent6ad2c0ba3b84dffc86def566a9d6688d5a25e2d4 (diff)
parent00c84f21871a8df8c4acfd9469be80095f6c6a7d (diff)
Merge s-mpr-2021-12-05
Change-Id: Ie30e6decc687dd07c62f61760ea1900c619d6ce0
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;