diff --git a/compiler/circle2circle/src/Circle2Circle.cpp b/compiler/circle2circle/src/Circle2Circle.cpp index 16100dbbeb7..34f9ffaf55c 100644 --- a/compiler/circle2circle/src/Circle2Circle.cpp +++ b/compiler/circle2circle/src/Circle2Circle.cpp @@ -515,7 +515,7 @@ int entry(int argc, char **argv) luci::change_outputs(graph, new_outputs); } - // call luci optimizations for module before optimizations for graph + // call luci optimizations for module optimizer.optimize(module.get()); for (size_t idx = 0; idx < module->size(); ++idx) diff --git a/compiler/luci/pass/src/EliminateDeadSubgraphPass.cpp b/compiler/luci/pass/src/EliminateDeadSubgraphPass.cpp index b2670df7335..5653c1b6e9f 100644 --- a/compiler/luci/pass/src/EliminateDeadSubgraphPass.cpp +++ b/compiler/luci/pass/src/EliminateDeadSubgraphPass.cpp @@ -49,37 +49,34 @@ void checkGraph(loco::Graph *current_graph, std::deque &reachable_graphs // TODO: check all nodes which can be used to reach different subgraph for (auto &node : active_nodes) { - auto *circle_node = dynamic_cast(node); - assert(circle_node != nullptr); + auto *circle_node = loco::must_cast(node); switch (circle_node->opcode()) { case CircleOpcode::WHILE: { - auto *while_node = dynamic_cast(circle_node); - assert(while_node != nullptr); + auto *while_node = loco::must_cast(circle_node); // Get body and cond graph indexes int32_t body_graph_index = while_node->body_branch(); int32_t cond_graph_index = while_node->cond_branch(); assert(body_graph_index >= 0); assert(cond_graph_index >= 0); // Add indexes into queue - reachable_graphs_indexes_q.push_back(size_t(body_graph_index)); - reachable_graphs_indexes_q.push_back(size_t(cond_graph_index)); + reachable_graphs_indexes_q.push_back(static_cast(body_graph_index)); + reachable_graphs_indexes_q.push_back(static_cast(cond_graph_index)); } break; case CircleOpcode::IF: { - auto *if_node = dynamic_cast(circle_node); - assert(if_node != nullptr); + auto *if_node = loco::must_cast(circle_node); // Get then and else graph indexes int32_t else_index = if_node->else_branch(); int32_t then_index = if_node->then_branch(); assert(else_index >= 0); assert(then_index >= 0); // Add indexes into queue - reachable_graphs_indexes_q.push_back(size_t(else_index)); - reachable_graphs_indexes_q.push_back(size_t(then_index)); + reachable_graphs_indexes_q.push_back(static_cast(else_index)); + reachable_graphs_indexes_q.push_back(static_cast(then_index)); } break; default: