Skip to content

Commit e0b05db

Browse files
sys-igcigcbot
authored andcommitted
[Autobackout][FunctionalRegression]Revert of change: ee5bffc: Prevent duplicate keys in CEncoder::m_visaUserOptions
This commit changes m_visaUserOptions type from std::vector to std::unordered_map to prevent adding duplicate visa option keys.
1 parent b413466 commit e0b05db

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

IGC/Compiler/CISACodeGen/CISABuilder.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3925,21 +3925,21 @@ namespace IGC
39253925
OptionValue entry;
39263926
entry.type = OpType::ET_BOOL;
39273927
entry.vBool = val;
3928-
m_visaUserOptions.insert(std::make_pair(option, entry));
3928+
m_visaUserOptions.push_back(std::make_pair(option, entry));
39293929
}
39303930
void CEncoder::SaveOption(vISAOptions option, uint32_t val)
39313931
{
39323932
OptionValue entry;
39333933
entry.type = OpType::ET_INT32;
39343934
entry.vInt32 = val;
3935-
m_visaUserOptions.insert(std::make_pair(option, entry));
3935+
m_visaUserOptions.push_back(std::make_pair(option, entry));
39363936
}
39373937
void CEncoder::SaveOption(vISAOptions option, const char* val)
39383938
{
39393939
OptionValue entry;
39403940
entry.type = OpType::ET_CSTR;
39413941
entry.vCstr = val;
3942-
m_visaUserOptions.insert(std::make_pair(option, entry));
3942+
m_visaUserOptions.push_back(std::make_pair(option, entry));
39433943
}
39443944
void CEncoder::SetBuilderOptions(VISABuilder* pbuilder)
39453945
{
@@ -4856,8 +4856,7 @@ namespace IGC
48564856
// "Auto" mode per kernel function (by user annotation) - use compiler heuristics to determin number of threads per EU
48574857
SaveOption(vISA_AutoGRFSelection, true);
48584858
}
4859-
else if (ClContext->getExpGRFSize() > 0)
4860-
{
4859+
else if (ClContext->getExpGRFSize() > 0) {
48614860
// Explicit GRF size set per module (by compiler option)
48624861
SaveOption(vISA_TotalGRFNum, ClContext->getExpGRFSize());
48634862
}

IGC/Compiler/CISACodeGen/CISABuilder.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ namespace IGC
812812
const char* vCstr;
813813
};
814814
// List of vISA user options
815-
std::unordered_map<vISAOptions, OptionValue> m_visaUserOptions;
815+
std::vector<std::pair<vISAOptions, OptionValue>> m_visaUserOptions;
816816

817817
// Typically IGC just use ones vKernel for every vISA::compile call,
818818
// in those cases, vKernel and vMainKernel should be the same.

0 commit comments

Comments
 (0)