From 9c8158d770dd0b2d0b70dff6838c48b0e4df886b Mon Sep 17 00:00:00 2001 From: Vedant Paranjape <22630228+VedantParanjape@users.noreply.github.com> Date: Fri, 29 Sep 2023 02:08:00 +0530 Subject: [PATCH] WIP v6: reduce number of redundant continue stmts, few still remain --- src/blocks/loops.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/blocks/loops.cpp b/src/blocks/loops.cpp index d2a35eb..c830edd 100644 --- a/src/blocks/loops.cpp +++ b/src/blocks/loops.cpp @@ -383,7 +383,9 @@ stmt::Ptr loop::convert_to_ast_impl(dominator_analysis &dta_, std::vectorid)) + if (!blocks_id_map.count(next_preorder) || !blocks_id_map.count(next_next_preorder)) + is_last_block = true; + else if (unique_exit_block && (next_preorder == (int)unique_exit_block->id)) is_last_block = true; else if (unique_exit_block && (next_next_preorder == (int)unique_exit_block->id)) is_last_block = true; @@ -397,6 +399,7 @@ stmt::Ptr loop::convert_to_ast_impl(dominator_analysis &dta_, std::vectorid << loop_id << "\n"; ast->stmts.push_back(to(std::make_shared())); while_block->continue_blocks.push_back(ast); }