Skip to content

Commit c82d949

Browse files
jgu222igcbot
authored andcommitted
Minor refactoring[NFC]
Preparing for turning store combining for other APIs ( the existing code is for OCL only). This change has no functional change.
1 parent b41d422 commit c82d949

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

IGC/Compiler/CISACodeGen/MemOpt.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2586,6 +2586,10 @@ const BundleSize_t BundleConfig::m_d32VecSizes_u = { 2,3,4,8,16,32,64 };
25862586
const BundleSize_t BundleConfig::m_d8VecSizes_u = { 2,4,8,16,32 };
25872587

25882588
bool IGC::doLdStCombine(const CodeGenContext* CGC) {
2589+
// start with OCL, will apply to others.
2590+
if (CGC->type != ShaderType::OPENCL_SHADER)
2591+
return false;
2592+
25892593
if (CGC->type == ShaderType::OPENCL_SHADER) {
25902594
auto oclCtx = (const OpenCLProgramContext*)CGC;
25912595
// internal flag overrides IGC key

IGC/Compiler/CISACodeGen/ShaderCodeGen.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -668,11 +668,8 @@ void AddLegalizationPasses(CodeGenContext& ctx, IGCPassManager& mpm, PSSignature
668668
if (IGC_IS_FLAG_ENABLED(EnableAdvMemOpt))
669669
mpm.add(createAdvMemOptPass());
670670

671-
if (doLdStCombine(&ctx) &&
672-
ctx.type == ShaderType::OPENCL_SHADER)
673-
{
674-
// start with OCL, will apply to others.
675-
// Once it is stable, no split 64bit store/load anymore.
671+
if (doLdStCombine(&ctx)) {
672+
// Once it is stable, no split 64bit store/load anymore.
676673
mpm.add(createLdStCombinePass());
677674
}
678675

0 commit comments

Comments
 (0)