Skip to content

Commit 522e26a

Browse files
weiyu-chensys_zuul
authored andcommitted
Avoid hard-coded SIMD size checks for sampler payload coalescing.
Change-Id: Id1f9c82bcd24b91b34e30e8b35c3859c1009926d
1 parent f9315fa commit 522e26a

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

IGC/Compiler/CISACodeGen/CShader.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ void CShader::PreAnalysisPass()
131131
if (GetContext()->getModuleMetaData()->compOpt.UseScratchSpacePrivateMemory)
132132
{
133133
m_ScratchSpaceSize = funcMDItr->second.privateMemoryPerWI * numLanes(m_dispatchSize);
134-
// Round up to GENX_GRF_REG_SIZ-byte aligned.
134+
// Round up to GRF-byte aligned.
135135
m_ScratchSpaceSize =
136-
((GENX_GRF_REG_SIZ + m_ScratchSpaceSize - 1) / GENX_GRF_REG_SIZ) * GENX_GRF_REG_SIZ;
136+
((getGRFSize() + m_ScratchSpaceSize - 1) / getGRFSize()) * getGRFSize();
137137

138138
}
139139
}
@@ -1998,10 +1998,10 @@ CVariable* CShader::LazyCreateCCTupleBackingVariable(
19981998
var = ccTupleMapping[ccTuple];
19991999
}
20002000
else {
2001-
auto mult = (m_SIMDSize == SIMDMode::SIMD8) ? 1 : 2;
2001+
auto mult = (m_SIMDSize == m_Platform->getMinDispatchMode()) ? 1 : 2;
20022002
mult = (baseVisaType == ISA_TYPE_HF) ? 1 : mult;
20032003
unsigned int numRows = ccTuple->GetNumElements() * mult;
2004-
unsigned int numElts = numRows * GENX_GRF_REG_SIZ / CEncoder::GetCISADataTypeSize(ISA_TYPE_F);
2004+
unsigned int numElts = numRows * getGRFSize() / CEncoder::GetCISADataTypeSize(ISA_TYPE_F);
20052005

20062006
//int size = numLanes(m_SIMDSize) * ccTuple->GetNumElements();
20072007
if (ccTuple->HasNonHomogeneousElements())
@@ -3008,7 +3008,7 @@ bool CShader::VMECoalescePattern(GenIntrinsicInst* genInst)
30083008
bool CShader::isUnpacked(llvm::Value* value)
30093009
{
30103010
bool isUnpacked = false;
3011-
if (m_SIMDSize == SIMDMode::SIMD8)
3011+
if (m_SIMDSize == m_Platform->getMinDispatchMode())
30123012
{
30133013
if (isa<SampleIntrinsic>(value) || isa<LdmcsInstrinsic>(value))
30143014
{

IGC/Compiler/CISACodeGen/PayloadMapping.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4545
#include "GenISAIntrinsics/GenIntrinsicInst.h"
4646
#include "common/Types.hpp"
4747

48-
#define GENX_GRF_REG_SIZ 32 // # of bytes in a GRF register
49-
5048
namespace IGC
5149
{
5250

0 commit comments

Comments
 (0)