Skip to content

Commit 291cb5a

Browse files
DianaChensys_zuul
authored andcommitted
Add ocl compiler flag "-cl-intel-disable-a64WA" to disable A64 WA
Change-Id: I5c7faec0269b153308516ff6bf8b3529a482b1d4
1 parent 6a16031 commit 291cb5a

File tree

7 files changed

+35
-5
lines changed

7 files changed

+35
-5
lines changed

IGC/AdaptorOCL/UnifyIROCL.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,9 @@ static void CommonOCLBasedPasses(
243243
CompilerOpts.GreaterThan4GBBufferRequired =
244244
pContext->m_InternalOptions.IntelGreaterThan4GBBufferRequired;
245245

246+
CompilerOpts.DisableA64WA =
247+
pContext->m_InternalOptions.IntelDisableA64WA;
248+
246249
CompilerOpts.HasBufferOffsetArg =
247250
pContext->m_InternalOptions.IntelHasBufferOffsetArg;
248251

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14415,9 +14415,16 @@ void EmitPass::A64LSLoopTail(CVariable* curMask, CVariable* lsPred, uint label)
1441514415
m_encoder->SetSecondHalf(tmpSh);
1441614416
}
1441714417

14418+
bool EmitPass::hasA64WAEnable() const
14419+
{
14420+
if (m_pCtx->getModuleMetaData()->compOpt.DisableA64WA)
14421+
return false;
14422+
return m_currShader->m_Platform->WaEnableA64WA();
14423+
}
14424+
1441814425
void EmitPass::emitGatherA64(CVariable* dst, CVariable* offset, unsigned elemSize, unsigned numElems)
1441914426
{
14420-
if (IGC_IS_FLAG_ENABLED(EnableA64WA) && !offset->IsUniform()) {
14427+
if (hasA64WAEnable() && !offset->IsUniform()) {
1442114428
CVariable* curMask = nullptr;
1442214429
CVariable* lsPred = nullptr;
1442314430
uint label = 0;
@@ -14437,7 +14444,7 @@ void EmitPass::emitGatherA64(CVariable* dst, CVariable* offset, unsigned elemSiz
1443714444

1443814445
void EmitPass::emitGather4A64(CVariable* dst, CVariable* offset)
1443914446
{
14440-
if (IGC_IS_FLAG_ENABLED(EnableA64WA) && !offset->IsUniform()) {
14447+
if (hasA64WAEnable() && !offset->IsUniform()) {
1444114448
CVariable* curMask = nullptr;
1444214449
CVariable* lsPred = nullptr;
1444314450
uint label = 0;
@@ -14458,7 +14465,7 @@ void EmitPass::emitGather4A64(CVariable* dst, CVariable* offset)
1445814465

1445914466
void EmitPass::emitScatterA64(CVariable* val, CVariable* offset, unsigned elementSize, unsigned numElems)
1446014467
{
14461-
if (IGC_IS_FLAG_ENABLED(EnableA64WA) && !offset->IsUniform()) {
14468+
if (hasA64WAEnable() && !offset->IsUniform()) {
1446214469
CVariable* curMask = nullptr;
1446314470
CVariable* lsPred = nullptr;
1446414471
uint label = 0;
@@ -14479,7 +14486,7 @@ void EmitPass::emitScatterA64(CVariable* val, CVariable* offset, unsigned elemen
1447914486

1448014487
void EmitPass::emitScatter4A64(CVariable* src, CVariable* offset)
1448114488
{
14482-
if (IGC_IS_FLAG_ENABLED(EnableA64WA) && !offset->IsUniform()) {
14489+
if (hasA64WAEnable() && !offset->IsUniform()) {
1448314490
CVariable* curMask = nullptr;
1448414491
CVariable* lsPred = nullptr;
1448514492
uint label = 0;

IGC/Compiler/CISACodeGen/EmitVISAPass.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,9 @@ namespace IGC
644644
// Helper functions that create loop for above WA
645645
void A64LSLoopHead(CVariable* addr, CVariable*& curMask, CVariable*& lsPred, uint& label);
646646
void A64LSLoopTail(CVariable* curMask, CVariable* lsPred, uint label);
647+
648+
// Helper function to check if A64 WA is required
649+
bool hasA64WAEnable() const;
647650
};
648651

649652
} // namespace IGC

IGC/Compiler/CISACodeGen/Platform.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,15 @@ namespace IGC
508508
return IGFX_GEN11_CORE >= m_platformInfo.eRenderCoreFamily;
509509
}
510510

511+
bool WaEnableA64WA() const
512+
{
513+
if (IGC_IS_FLAG_ENABLED(EnableA64WA)) {
514+
if (m_platformInfo.eProductFamily == IGFX_TIGERLAKE_LP)
515+
return true;
516+
}
517+
return false;
518+
}
519+
511520
const SCompilerHwCaps& GetCaps() { return m_caps; }
512521
};
513522

IGC/Compiler/CodeGenPublic.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,6 +1064,11 @@ namespace IGC
10641064
IntelHasBufferOffsetArg = true;
10651065
}
10661066

1067+
if (strstr(options, "-cl-intel-disable-a64WA"))
1068+
{
1069+
IntelDisableA64WA = true;
1070+
}
1071+
10671072
if (strstr(options, "-cl-intel-gtpin-rera"))
10681073
{
10691074
DoReRA = true;
@@ -1091,6 +1096,7 @@ namespace IGC
10911096
bool IncludeSIPCSR;
10921097
bool IncludeSIPKernelDebug;
10931098
bool IntelGreaterThan4GBBufferRequired;
1099+
bool IntelDisableA64WA = false;
10941100
bool Use32BitPtrArith = false;
10951101
bool IncludeSIPKernelDebugWithLocalMemory;
10961102
bool DoReRA;

IGC/OCLFE/igd_fcl_mcl/source/clang_tb.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1348,7 +1348,8 @@ namespace TC
13481348
(strcmp(pParam, "-igc_opts") == 0) || //temporary options
13491349
(strcmp(pParam, "-cl-intel-debug-info") == 0) ||
13501350
(strncmp(pParam, "-dump-opt-llvm", 14) == 0) ||
1351-
(strcmp(pParam, "-cl-no-subgroup-ifp") == 0);
1351+
(strcmp(pParam, "-cl-no-subgroup-ifp") == 0) ||
1352+
(strcmp(pParam, "-cl-intel-disable-a64WA") == 0); //temporary options;
13521353

13531354

13541355

IGC/common/MDFrameWork.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ namespace IGC
205205
bool SubgroupIndependentForwardProgressRequired = true;
206206
bool GreaterThan2GBBufferRequired = true;
207207
bool GreaterThan4GBBufferRequired = true;
208+
bool DisableA64WA = false;
208209
bool PushConstantsEnable = true;
209210
bool HasBufferOffsetArg = false;
210211
bool replaceGlobalOffsetsByZero = false;

0 commit comments

Comments
 (0)