File tree Expand file tree Collapse file tree 5 files changed +824
-577
lines changed Expand file tree Collapse file tree 5 files changed +824
-577
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ class basic_block {
1616 block::expr::Ptr branch_expr;
1717 std::shared_ptr<basic_block> then_branch;
1818 std::shared_ptr<basic_block> else_branch;
19+ std::shared_ptr<basic_block> exit_block;
1920 bool is_exit_block;
2021 block::stmt::Ptr parent;
2122 unsigned int ast_index;
Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ using namespace block;
1010class loop {
1111public:
1212 loop (std::shared_ptr<basic_block> header): header_block(header) {}
13+ stmt::Ptr convert_to_ast_impl (dominator_analysis &dta_);
1314
14- // private:
1515 struct loop_bounds_ {
1616 stmt::Ptr ind_var;
1717 // MISS: intial value of ind var
@@ -28,6 +28,7 @@ class loop {
2828 std::unordered_set<int > blocks_id_map;
2929 std::shared_ptr<loop> parent_loop;
3030 std::shared_ptr<basic_block> header_block;
31+ std::shared_ptr<basic_block> condition_block;
3132 std::shared_ptr<basic_block> unique_exit_block;
3233 basic_block::cfg_block loop_latch_blocks;
3334 basic_block::cfg_block loop_exit_blocks;
Original file line number Diff line number Diff line change @@ -137,6 +137,9 @@ basic_block::cfg_block generate_basic_blocks(block::stmt_block::Ptr ast) {
137137 if (!bb->then_branch ) bb->then_branch = exit_bb;
138138 else if (!bb->else_branch ) bb->else_branch = exit_bb;
139139
140+ // set the exit block of this if stmt
141+ bb->exit_block = exit_bb;
142+
140143 return_list.push_back (bb);
141144 }
142145 else if (isa<block::expr_stmt>(bb->parent )) {
You can’t perform that action at this time.
0 commit comments