Skip to content

Commit a7ed19e

Browse files
ichenkaiigcbot
authored andcommitted
Optimize vector oword block load
Use vector copy instead of oword block load on specific device.
1 parent dbad589 commit a7ed19e

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17762,7 +17762,6 @@ void EmitPass::emitVectorLoad(LoadInst* inst, Value* offset, ConstantInt* immOff
1776217762
return;
1776317763
}
1776417764

17765-
1776617765
bool bEmulateDWAligned = false;
1776717766

1776817767
// generate oword-load if possible
@@ -17783,6 +17782,17 @@ void EmitPass::emitVectorLoad(LoadInst* inst, Value* offset, ConstantInt* immOff
1778317782
bool needTemp = (!destUniform || !IsGRFAligned(m_destination, EALIGN_GRF));
1778417783
CVariable * loadDest = m_destination;
1778517784

17785+
// (needTemp = false) means GRF aligned as (destUniform = true)
17786+
if (!useDWAligned && useOWAligned && !needTemp &&
17787+
srcUniform && destUniform &&
17788+
destType == VISA_Type::ISA_TYPE_F &&
17789+
eOffset->GetType() == VISA_Type::ISA_TYPE_UD &&
17790+
m_currShader->m_Platform->allowFastestSIMDVectorLoad4Perf())
17791+
{
17792+
emitVectorCopy(loadDest, eOffset, elts);
17793+
return;
17794+
}
17795+
1778617796
if (useOWAligned)
1778717797
{
1778817798
// Offset needs to be in OW!

IGC/Compiler/CISACodeGen/Platform.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1787,5 +1787,11 @@ bool allowDivergentControlFlowRayQueryCheckRelease() const
17871787
return m_WaTable.Wa_22019804511 != 0;
17881788
}
17891789

1790+
bool allowFastestSIMDVectorLoad4Perf() const
1791+
{
1792+
return m_platformInfo.eProductFamily == IGFX_ALDERLAKE_P &&
1793+
m_platformInfo.usDeviceID == 0x4626;
1794+
}
1795+
17901796
};
17911797
}//namespace IGC

0 commit comments

Comments
 (0)