Skip to content

Commit e56ec07

Browse files
skarczewigcbot
authored andcommitted
Adjust number of pushed inputs if number of GRFs is forced
Always aim to have 3/4 GRFs available for pushing inputs
1 parent ecd48cf commit e56ec07

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

IGC/Compiler/CISACodeGen/DriverInfo.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,6 @@ namespace IGC
302302
return 4 * sizeof(MEGABYTE);
303303
}
304304

305-
// Limits simple push constants based on pushed inputs
306-
virtual bool EnableSimplePushRestriction() const { return false; }
307-
308305
// Determines whether the PAYLOAD_HEADER implicit arg must be present
309306
virtual bool RequirePayloadHeader() const { return true; }
310307

IGC/Compiler/CISACodeGen/PushAnalysis.cpp

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,17 +1000,13 @@ namespace IGC
10001000
auto& inputs = m_context->getModuleMetaData()->pushInfo.inputs;
10011001
typedef const std::map<unsigned int, SInputDesc>::value_type& inputPairType;
10021002
unsigned int largestIndex = 0;
1003-
if (m_context->m_DriverInfo.EnableSimplePushRestriction())
1004-
{
1005-
auto largestPair = std::max_element(inputs.begin(), inputs.end(),
1006-
[](inputPairType a, inputPairType b) { return a.second.index < b.second.index; });
1007-
largestIndex = largestPair != inputs.end() ? largestPair->second.index : 0;
1008-
}
1009-
unsigned int maxPushedGRFs = 96;
1010-
if (m_context->platform.isCoreChildOf(IGFX_XE3_CORE))
1011-
{
1012-
maxPushedGRFs *= 2;
1013-
}
1003+
auto largestPair = std::max_element(inputs.begin(), inputs.end(),
1004+
[](inputPairType a, inputPairType b) { return a.second.index < b.second.index; });
1005+
largestIndex = largestPair != inputs.end() ? largestPair->second.index : 0;
1006+
1007+
uint32_t maxPushedGRFs = m_context->getNumGRFPerThread(false) ? (3 * m_context->getNumGRFPerThread(false)) / 4 :
1008+
m_context->platform.supportsVRT() ? ((3 * 256) / 4) : ((3 * 128) / 4);
1009+
10141010
if (largestIndex >= maxPushedGRFs)
10151011
{
10161012
return;

0 commit comments

Comments
 (0)