From a513ef08ce5ac79127fb17f8d589b9cc2cfb1667 Mon Sep 17 00:00:00 2001 From: Alexandra Sidorova Date: Fri, 2 Jun 2023 14:49:47 +0400 Subject: [PATCH 1/2] [Snippets] Fixed set for Windows --- src/common/snippets/src/lowered/loop_manager.cpp | 3 ++- src/common/snippets/src/lowered/pass/assign_registers.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/common/snippets/src/lowered/loop_manager.cpp b/src/common/snippets/src/lowered/loop_manager.cpp index a29c2eed12a333..88729c21e957a7 100644 --- a/src/common/snippets/src/lowered/loop_manager.cpp +++ b/src/common/snippets/src/lowered/loop_manager.cpp @@ -106,7 +106,8 @@ void LinearIR::LoopManager::get_io_loop_ports(LinearIR::constExprIt loop_begin_p const auto& expr = *expr_it; for (size_t i = 0; i < expr->get_input_count(); ++i) { const auto in_port = expr->get_input_port(i); - const auto& parent_expr = in_port.get_connected_ports().begin()->get_expr(); + const auto source_port = *in_port.get_connected_ports().begin(); + const auto& parent_expr = source_port.get_expr(); if (!ov::is_type(parent_expr->get_node()) && std::find(loop_begin_pos, expr_it, parent_expr) == expr_it) { entries.push_back(in_port); diff --git a/src/common/snippets/src/lowered/pass/assign_registers.cpp b/src/common/snippets/src/lowered/pass/assign_registers.cpp index bdfec24b7e2b8c..bf51021875f85f 100644 --- a/src/common/snippets/src/lowered/pass/assign_registers.cpp +++ b/src/common/snippets/src/lowered/pass/assign_registers.cpp @@ -86,11 +86,13 @@ bool AssignRegisters::run(LinearIR& linear_ir) { // TODO: Fix via common pipeline using LoopEnd: // All operations `outside loop` after Horizon ops should have the same register to avoid using it in the next Loop const auto current_loops_ids = expr->get_loop_ids(); - auto next_expr = output_tensor->get_consumers().begin()->get_expr(); + auto port = *output_tensor->get_consumers().begin(); + auto next_expr = port.get_expr(); while (next_expr->get_loop_ids() == current_loops_ids) { manually_assigned_vecs[next_expr->get_output_port_connector(0)] = static_cast(accumulator_reg); - next_expr = next_expr->get_output_port_connector(0)->get_consumers().begin()->get_expr(); + port = *next_expr->get_output_port_connector(0)->get_consumers().begin(); + next_expr = port.get_expr(); } accumulator_reg++; From 7089efe29b102b7b82cfbda68f7297c5a88b9063 Mon Sep 17 00:00:00 2001 From: Alexandra Sidorova Date: Thu, 8 Jun 2023 18:35:54 +0400 Subject: [PATCH 2/2] Another taste --- src/common/snippets/src/lowered/loop_manager.cpp | 3 +-- src/common/snippets/src/lowered/pass/assign_registers.cpp | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/common/snippets/src/lowered/loop_manager.cpp b/src/common/snippets/src/lowered/loop_manager.cpp index 88729c21e957a7..83b0b933b39802 100644 --- a/src/common/snippets/src/lowered/loop_manager.cpp +++ b/src/common/snippets/src/lowered/loop_manager.cpp @@ -106,8 +106,7 @@ void LinearIR::LoopManager::get_io_loop_ports(LinearIR::constExprIt loop_begin_p const auto& expr = *expr_it; for (size_t i = 0; i < expr->get_input_count(); ++i) { const auto in_port = expr->get_input_port(i); - const auto source_port = *in_port.get_connected_ports().begin(); - const auto& parent_expr = source_port.get_expr(); + const auto parent_expr = in_port.get_connected_ports().begin()->get_expr(); if (!ov::is_type(parent_expr->get_node()) && std::find(loop_begin_pos, expr_it, parent_expr) == expr_it) { entries.push_back(in_port); diff --git a/src/common/snippets/src/lowered/pass/assign_registers.cpp b/src/common/snippets/src/lowered/pass/assign_registers.cpp index bf51021875f85f..bdfec24b7e2b8c 100644 --- a/src/common/snippets/src/lowered/pass/assign_registers.cpp +++ b/src/common/snippets/src/lowered/pass/assign_registers.cpp @@ -86,13 +86,11 @@ bool AssignRegisters::run(LinearIR& linear_ir) { // TODO: Fix via common pipeline using LoopEnd: // All operations `outside loop` after Horizon ops should have the same register to avoid using it in the next Loop const auto current_loops_ids = expr->get_loop_ids(); - auto port = *output_tensor->get_consumers().begin(); - auto next_expr = port.get_expr(); + auto next_expr = output_tensor->get_consumers().begin()->get_expr(); while (next_expr->get_loop_ids() == current_loops_ids) { manually_assigned_vecs[next_expr->get_output_port_connector(0)] = static_cast(accumulator_reg); - port = *next_expr->get_output_port_connector(0)->get_consumers().begin(); - next_expr = port.get_expr(); + next_expr = next_expr->get_output_port_connector(0)->get_consumers().begin()->get_expr(); } accumulator_reg++;