diff --git a/level_zero/core/source/module/module_imp.cpp b/level_zero/core/source/module/module_imp.cpp index 6e9eaa8f79..7912f5800a 100644 --- a/level_zero/core/source/module/module_imp.cpp +++ b/level_zero/core/source/module/module_imp.cpp @@ -728,6 +728,8 @@ inline ze_result_t ModuleImp::initializeTranslationUnit(const ze_module_desc_t * this->createBuildOptions(nullptr, buildOptions, internalBuildOptions); + inputSpirVs.reserve(programExpDesc->count); + inputModuleSizes.reserve(programExpDesc->count); for (uint32_t i = 0; i < static_cast(programExpDesc->count); i++) { std::string tmpBuildOptions; std::string tmpInternalBuildOptions; @@ -750,11 +752,11 @@ inline ze_result_t ModuleImp::initializeTranslationUnit(const ze_module_desc_t * // If the user passed in only 1 SPIRV, then fallback to standard build if (inputSpirVs.size() > 1) { this->precompiled = false; - return this->translationUnit->staticLinkSpirV(inputSpirVs, - inputModuleSizes, + return this->translationUnit->staticLinkSpirV(std::move(inputSpirVs), + std::move(inputModuleSizes), buildOptions.c_str(), internalBuildOptions.c_str(), - specConstants); + std::move(specConstants)); } else { this->precompiled = false; return this->translationUnit->buildFromSpirV(reinterpret_cast(programExpDesc->pInputModules[0]), diff --git a/level_zero/experimental/source/mutable_cmdlist/program/mcl_decoder.cpp b/level_zero/experimental/source/mutable_cmdlist/program/mcl_decoder.cpp index 6f5eb670a2..7a3e7dd094 100644 --- a/level_zero/experimental/source/mutable_cmdlist/program/mcl_decoder.cpp +++ b/level_zero/experimental/source/mutable_cmdlist/program/mcl_decoder.cpp @@ -350,7 +350,7 @@ void MclDecoder::parseSymbols() { kernelData.kernelStartOffset = symbol.value; kernelData.kernelStartAddress = program.segments.ih.address + symbol.value; kernelData.kernelIsa = {program.segments.ih.initData.begin() + symbol.value, symbol.size}; - kernelDataVec.push_back(kernelData); + kernelDataVec.push_back(std::move(kernelData)); } else if (symbol.section == Sections::SectionType::shtIoh) { auto dispatchId = std::stoi(symbolName.substr(Symbols::SymbolNames::iohPrefix.length()).str()); UNRECOVERABLE_IF(static_cast(dispatchId) >= dispatchInfos.size()); diff --git a/shared/offline_compiler/source/decoder/zebin_manipulator.cpp b/shared/offline_compiler/source/decoder/zebin_manipulator.cpp index ebc2365b91..96ed9d1511 100644 --- a/shared/offline_compiler/source/decoder/zebin_manipulator.cpp +++ b/shared/offline_compiler/source/decoder/zebin_manipulator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022-2024 Intel Corporation + * Copyright (C) 2022-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -221,9 +221,9 @@ Usage: ocloc disasm -file [-dump ] [-device ] [-sk -dump Optional. Path for files representing decoded binary. Default is './dump'. - -device Optional. Target device of input binary. + -device Optional. Target device of input binary. - -skip-asm-translation Optional. Skips parsing intelGTNotes for device and skips kernel + -skip-asm-translation Optional. Skips parsing intelGTNotes for device and skips kernel translation to assembly. --help Print this usage message. @@ -616,7 +616,7 @@ ErrorCode ZebinEncoder::appendSymtab(ElfEncoderT &encoder, const Sectio } size_t numLocalSymbols = 0; - auto symbols = parseSymbols(symTabLines, encoder, numLocalSymbols, secNameToId); + auto symbols = parseSymbols(symTabLines, encoder, numLocalSymbols, std::move(secNameToId)); auto &symtabSection = encoder.appendSection(section.type, section.name, ArrayRef::fromAny(symbols.data(), symbols.size())); symtabSection.info = static_cast(numLocalSymbols); diff --git a/shared/offline_compiler/source/offline_compiler.cpp b/shared/offline_compiler/source/offline_compiler.cpp index b6cc75b477..724882ae9d 100644 --- a/shared/offline_compiler/source/offline_compiler.cpp +++ b/shared/offline_compiler/source/offline_compiler.cpp @@ -212,9 +212,9 @@ std::vector getCommonNameVersion(const std::vector getCommonExtensions(std::vector products, bool needVersions, OclocArgHelper *helper) { std::vector> perTarget; + perTarget.reserve(products.size()); for (const auto &targetProduct : products) { - auto extensions = OfflineCompiler::getExtensions(targetProduct, needVersions, helper); - perTarget.push_back(extensions); + perTarget.push_back(OfflineCompiler::getExtensions(targetProduct, needVersions, helper)); } auto commonExtensions = getCommonNameVersion(perTarget); diff --git a/shared/source/device_binary_format/elf/elf_decoder.cpp b/shared/source/device_binary_format/elf/elf_decoder.cpp index 5696746a66..3e390b2e01 100644 --- a/shared/source/device_binary_format/elf/elf_decoder.cpp +++ b/shared/source/device_binary_format/elf/elf_decoder.cpp @@ -162,7 +162,7 @@ bool Elf::decodeRelocations(SectionHeaderAndData §ionHeade RelocationInfo relocInfo = {symbolSectionIndex, symbolIndex, targetSectionIndex, rela->addend, rela->offset, relocType, std::move(name)}; - relocs.push_back(relocInfo); + relocs.push_back(std::move(relocInfo)); rela++; } }