OpenVINO™ is an open source toolkit for optimizing and deploying AI inference
C++ aicomputer-visiondeep-learningdeploy-aidiffusion-modelsgenerative-aigood-first-issueinferencellm-inferencenatural-language-processingnlpopenvinooptimize-aiperformance-boostrecommendation-systemspeech-recognitionstable-diffusiontransformersyolo
[CORE]Coverity performance inefficiencies (#30310)
barnasm10a7f35f02045
diff --git a/src/common/snippets/src/lowered/pass/propagate_subtensors.cpp b/src/common/snippets/src/lowered/pass/propagate_subtensors.cppindex 85beb784db3..08997d08cc3 100644--- a/src/common/snippets/src/lowered/pass/propagate_subtensors.cpp+++ b/src/common/snippets/src/lowered/pass/propagate_subtensors.cpp@@ -59,7 +59,6 @@ void propagate_updated_subtensor_through_loop(const LinearIR& linear_ir,if (port.is_processed()) {const auto& expr = port.get_expr_port()->get_expr();const auto& desc = port.get_expr_port()->get_descriptor_ptr();- auto subtensor = desc->get_subtensor();if (port.get_dim_idx() < desc->get_subtensor().size()) {desc->set_subtensor_dim(port.get_dim_idx(), new_dim_value);}diff --git a/src/common/snippets/src/pass/softmax_decomposition.cpp b/src/common/snippets/src/pass/softmax_decomposition.cppindex d381ecfbffb..5f00c770f4d 100644--- a/src/common/snippets/src/pass/softmax_decomposition.cpp+++ b/src/common/snippets/src/pass/softmax_decomposition.cpp@@ -58,7 +58,7 @@ SoftmaxDecomposition::SoftmaxDecomposition() {subtensor[i] = utils::get_full_dim_value();PortDescriptorUtils::set_port_descriptor(power->input(0), subtensor);- PortDescriptorUtils::set_port_descriptor(power->output(0), subtensor);+ PortDescriptorUtils::set_port_descriptor(power->output(0), std::move(subtensor));copy_runtime_info(softmax, {reduce_max, subtract, exp, reduce_sum, power, multiply});return ov::replace_node_update_name(softmax, multiply);diff --git a/src/common/snippets/src/utils/utils.cpp b/src/common/snippets/src/utils/utils.cppindex adbb000b1cc..e79fffe3542 100644--- a/src/common/snippets/src/utils/utils.cpp+++ b/src/common/snippets/src/utils/utils.cpp@@ -209,14 +209,14 @@ VectorDims get_preordered_vdims(const snippets::lowered::ExpressionPort& expr_poVectorDims get_projected_subtensor(const snippets::lowered::ExpressionPort& expr_port) {const auto& desc = expr_port.get_descriptor_ptr();- const auto shape = expr_port.get_type() == snippets::lowered::ExpressionPort::Type::Input+ const auto& shape = expr_port.get_type() == snippets::lowered::ExpressionPort::Type::Input? get_planar_vdims(expr_port): get_preordered_vdims(expr_port);auto subtensor = desc->get_subtensor();for (size_t i = 1; i <= std::min(subtensor.size(), shape.size()); i++) {- auto& dim = subtensor[subtensor.size() - i];- if (utils::is_full_dim_value(dim))+ if (auto& dim = subtensor[subtensor.size() - i]; utils::is_full_dim_value(dim)) {dim = shape[shape.size() - i];+ }}return subtensor;}