Skip to content

Commit 49bf847

Browse files
committed
Remove ConstBase and GlobalBase implicit arguments for PVC+ platforms
A second try (recommit) of a8cc7c1. This reverts commit 0a5a1c0.
1 parent 856caae commit 49bf847

File tree

2 files changed

+459
-2
lines changed

2 files changed

+459
-2
lines changed

IGC/Compiler/Optimizer/OpenCLPasses/ProgramScopeConstants/ProgramScopeConstantAnalysis.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,17 @@ bool ProgramScopeConstantAnalysis::runOnModule(Module& M)
264264
// Stackcalls:
265265
// Stackcall ABI does not allow implicit args, so rely on relocation for global variable access
266266

267+
// Disable ConstBase and GlobalBase implicit arguments on PVC+.
268+
// StatelessToStateful pass is not enabled for most of the cases so there
269+
// is no benefit to add the implicit arguments. Const/Global variables
270+
// access can just go through relocations.
267271
// Workaround: When there is stringConstants in the module, do not insert
268272
// implicit arguments to prevent const vars getting promoted
269273
// at statelessToStateful pass. In zebin path, stateful promotion
270274
// of const vars can't work well with printf strings.
271-
bool skipConstAndGlobalBaseArgs =
272-
Ctx->enableZEBinary() && !m_pModuleMd->stringConstants.empty();
275+
bool skipConstAndGlobalBaseArgs = Ctx->enableZEBinary() &&
276+
(Ctx->platform.GetProductFamily() >= IGFX_PVC ||
277+
!m_pModuleMd->stringConstants.empty());
273278

274279
if (!skipConstAndGlobalBaseArgs && hasInlineConstantBuffer)
275280
{

0 commit comments

Comments
 (0)