Unify used flags in case of IR exclusion

Unifies usage of flags in case of IR exclusion from ocloc's output file.
When -exclude_ir parameter is active, then internal options passed to
IGC contain -exclude-ir-from-zebin to preserve consistency. Moreover,
when only -exclude-ir-from-zebin is present, then -exclude_ir is also set.

Related-To: NEO-6477
Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
This commit is contained in:
Patryk Wrobel
2021-12-16 16:15:46 +00:00
committed by Compute-Runtime-Automation
parent 617f65c285
commit 09eefb4968
5 changed files with 52 additions and 4 deletions

View File

@ -710,6 +710,8 @@ int OfflineCompiler::parseCommandLine(size_t numArgs, const std::vector<std::str
}
}
unifyExcludeIrFlags();
if (DebugManager.flags.OverrideRevision.get() != -1) {
revisionId = static_cast<unsigned short>(DebugManager.flags.OverrideRevision.get());
}
@ -737,6 +739,16 @@ int OfflineCompiler::parseCommandLine(size_t numArgs, const std::vector<std::str
return retVal;
}
void OfflineCompiler::unifyExcludeIrFlags() {
const auto excludeIrFromZebin{internalOptions.find(CompilerOptions::excludeIrFromZebin.data()) != std::string::npos};
if (!excludeIr && excludeIrFromZebin) {
excludeIr = true;
} else if (excludeIr && !excludeIrFromZebin) {
const std::string prefix{"-ze"};
CompilerOptions::concatenateAppend(internalOptions, prefix + CompilerOptions::excludeIrFromZebin.data());
}
}
void OfflineCompiler::setStatelessToStatefullBufferOffsetFlag() {
bool isStatelessToStatefulBufferOffsetSupported = true;
if (!deviceName.empty()) {