Skip to content

Commit

Permalink
Disable LSC L1 caching for ROVs
Browse files Browse the repository at this point in the history
Disable caching ROV accesses in LSC L1 cache.
  • Loading branch information
dburke4-intel authored and igcbot committed Jun 29, 2023
1 parent 9329aa5 commit 07d8a21
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions IGC/Compiler/CISACodeGen/EmitVISAPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20665,6 +20665,21 @@ LSC_CACHE_OPTS EmitPass::translateLSCCacheControlsFromMetadata(
Instruction* inst, bool isLoad, bool isTGM) const
{
LSC_CACHE_OPTS cacheOpts{ LSC_CACHING_DEFAULT, LSC_CACHING_DEFAULT };

if (inst &&
!m_currShader->m_ModuleMetadata->RasterizerOrderedViews.empty())
{
const auto& rasterizerOrderedViews = m_currShader->m_ModuleMetadata->RasterizerOrderedViews;
if (rasterizerOrderedViews.find(inst->getOperand(0)->getType()->getPointerAddressSpace()) != rasterizerOrderedViews.end())
{
// Do not cache ROV in non-coherent cache
MDNode* node = MDNode::get(
inst->getContext(),
ConstantAsMetadata::get(ConstantInt::get(Type::getInt32Ty(inst->getContext()), LSC_L1UC_L3C_WB)));
inst->setMetadata("lsc.cache.ctrl", node);
}
}

if (isTGM)
{
if (m_pCtx->platform.supportsNonDefaultLSCCacheSetting())
Expand Down
1 change: 1 addition & 0 deletions IGC/common/MDFrameWork.h
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@ namespace IGC
std::map<uint32_t, uint32_t> forceLscCacheList;
std::vector<SrvMapData> SrvMap;
std::vector<uint32_t> RasterizerOrderedByteAddressBuffer;
std::set<uint32_t> RasterizerOrderedViews;
unsigned int MinNOSPushConstantSize = 0;
llvm::MapVector<llvm::GlobalVariable*, int> inlineProgramScopeOffsets;
ShaderData shaderData;
Expand Down

0 comments on commit 07d8a21

Please sign in to comment.