Skip to content

Commit b4ff3ec

Browse files
srividyakarumurisys_zuul
authored andcommitted
Disable static check to push or fold constants
Change-Id: I6bb9e86b04604c4cf9085c1106b7a855997df513
1 parent fa0a8ab commit b4ff3ec

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

IGC/Compiler/CISACodeGen/PushAnalysis.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,10 @@ namespace IGC
268268
uint runtimeval0 = (uint)llvm::cast<llvm::ConstantInt>(pRuntimeVal->getOperand(0))->getZExtValue();
269269
PushInfo& pushInfo = m_context->getModuleMetaData()->pushInfo;
270270

271-
// then check for static root descriptor so that we can do push safely
271+
// then check for static flag so that we can do push safely
272272
for (auto it : pushInfo.pushableAddresses)
273273
{
274-
if (runtimeval0 * 4 == it.addressOffset && it.isStatic)
274+
if ((runtimeval0 * 4 == it.addressOffset) && (IGC_IS_FLAG_ENABLED(DisableStaticCheck) || it.isStatic))
275275
{
276276
GRFOffset = runtimeval0;
277277
return true;

IGC/Compiler/CustomSafeOptPass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2269,7 +2269,7 @@ Constant* IGCConstProp::replaceShaderConstant(LoadInst* inst)
22692269

22702270
for (auto it : pushInfo.pushableAddresses)
22712271
{
2272-
if (bufIdOrGRFOffset * 4 == it.addressOffset && it.isStatic)
2272+
if ((bufIdOrGRFOffset * 4 == it.addressOffset) && (IGC_IS_FLAG_ENABLED(DisableStaticCheck) || it.isStatic))
22732273
{
22742274
statelessBuf = true;
22752275
break;

IGC/Compiler/FindInterestingConstants.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ bool FindInterestingConstants::getConstantAddress(llvm::LoadInst& I, unsigned& b
218218

219219
for (auto it : pushInfo.pushableAddresses)
220220
{
221-
if (bufIdOrGRFOffset * 4 == it.addressOffset && it.isStatic)
221+
if ((bufIdOrGRFOffset * 4 == it.addressOffset) && (IGC_IS_FLAG_ENABLED(DisableStaticCheck) || it.isStatic))
222222
{
223223
statelessBuf = true;
224224
break;

IGC/common/igc_flags.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ DECLARE_IGC_REGKEY(bool, DisableUniformAnalysis, false, "Setting this to
9191
DECLARE_IGC_REGKEY(DWORD, DisablePushConstant, 0, "Bit mask to disable push constant per shader stages. bit0 = All, Bit 1 = VS, Bit 2 = HS, Bit 3 = DS, Bit 4 = GS, Bit 5 = PS", false)
9292
DECLARE_IGC_REGKEY(DWORD, DisableAttributePush, 0, "Bit mask to disable push Attribute per shader stages. bit0 = All, Bit 1 = VS, Bit 2 = HS, Bit 3 = DS, Bit 4 = GS", false)
9393
DECLARE_IGC_REGKEY(bool, DisableSimplePushWithDynamicUniformBuffers, false,"Disable Simple Push Constants Optimization for dynamic uniform buffers.", false)
94+
DECLARE_IGC_REGKEY(bool, DisableStaticCheck, false, "Disable static check to push or fold constants.", true)
9495
DECLARE_IGC_REGKEY(int, forcePushConstantMode, 0, "set the push constant mode, 0 is default, 1 is simple push, 2 is gather constant", false)
9596
DECLARE_IGC_REGKEY(bool, DisableConstantCoalescing, false, "Setting this to 1/true adds a compiler switch to disable constant coalesing", false)
9697
DECLARE_IGC_REGKEY(bool, UseHDCTypedReadForAllTextures, false, "Setting this to use HDC message rather than sampler ld for texture read", false)

0 commit comments

Comments
 (0)