Skip to content

Commit

Permalink
Increase pushed input limits
Browse files Browse the repository at this point in the history
VRT allows us to have more GRFs per thread, we can utilize this by
increasing the limit of pushed inputs.
  • Loading branch information
skarczew authored and igcbot committed Jan 30, 2025
1 parent 29e99d8 commit 2eae53f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 24 deletions.
35 changes: 18 additions & 17 deletions IGC/Compiler/CISACodeGen/PushAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,6 @@ namespace IGC

const uint32_t PushAnalysis::MaxConstantBufferIndexSize = 256;

/// The maximum number of input attributes that will be pushed as part of the payload.
/// One attribute is 4 dwords, so e.g. 16 means we allocate max 64 GRFs for input payload.
const uint32_t PushAnalysis::MaxNumOfPushedInputs = 24;

/// The size occupied by the tessellation header in dwords
const uint32_t PushAnalysis::TessFactorsURBHeader = 8;

/// Maximum number of attributes pushed
const uint32_t PushAnalysis::m_pMaxNumOfVSPushedInputs = 24;

const uint32_t PushAnalysis::m_pMaxNumOfHSPushedInputs = 24;

const uint32_t PushAnalysis::m_pMaxNumOfDSPushedInputs = 24;

const uint32_t PushAnalysis::m_pMaxNumOfGSPushedInputs = 24;

template < typename T > std::string to_string(const T& n)
{
std::ostringstream stm;
Expand Down Expand Up @@ -1022,7 +1006,11 @@ namespace IGC
[](inputPairType a, inputPairType b) { return a.second.index < b.second.index; });
largestIndex = largestPair != inputs.end() ? largestPair->second.index : 0;
}
const unsigned int maxPushedGRFs = 96;
unsigned int maxPushedGRFs = 96;
if (m_context->platform.isCoreChildOf(IGFX_XE3_CORE))
{
maxPushedGRFs *= 2;
}
if (largestIndex >= maxPushedGRFs)
{
return;
Expand Down Expand Up @@ -1620,6 +1608,19 @@ namespace IGC
m_pullConstantHeuristics = &getAnalysis<PullConstantHeuristics>();
m_context = getAnalysis<CodeGenContextWrapper>().getCodeGenContext();

if (m_context->platform.isCoreChildOf(IGFX_XE3_CORE))
{
MaxNumOfPushedInputs = 24 * 2;
m_pMaxNumOfVSPushedInputs = 24 * 2;
m_pMaxNumOfDSPushedInputs = 24 * 2;
}
else
{
MaxNumOfPushedInputs = 24;
m_pMaxNumOfVSPushedInputs = 24;
m_pMaxNumOfDSPushedInputs = 24;
}

MapList<Function*, Function*> funcsMapping;
bool retValue = false;

Expand Down
10 changes: 3 additions & 7 deletions IGC/Compiler/CISACodeGen/PushAnalysis.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,9 @@ namespace IGC
{
const llvm::DataLayout* m_DL;
static const uint32_t MaxConstantBufferIndexSize;
static const uint32_t MaxNumOfPushedInputs;
static const uint32_t TessFactorsURBHeader;
static const uint32_t HSEightPatchMaxNumOfPushedControlPoints;
static const uint32_t m_pMaxNumOfVSPushedInputs;
static const uint32_t m_pMaxNumOfHSPushedInputs;
static const uint32_t m_pMaxNumOfDSPushedInputs;
static const uint32_t m_pMaxNumOfGSPushedInputs;
uint32_t MaxNumOfPushedInputs;
uint32_t m_pMaxNumOfVSPushedInputs;
uint32_t m_pMaxNumOfDSPushedInputs;

bool m_funcTypeChanged;
std::map <llvm::Function*, bool> m_isFuncTypeChanged;
Expand Down

0 comments on commit 2eae53f

Please sign in to comment.