Skip to content

Commit 09ad3ad

Browse files
Gang Y Chenigcbot
authored andcommitted
flag for llvm reassociate
llvm reassociate is disabled by default. We can only enable it for GPGPU for performance experiment
1 parent 50f8b27 commit 09ad3ad

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

IGC/Compiler/CISACodeGen/ShaderCodeGen.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1724,13 +1724,16 @@ void OptimizeIR(CodeGenContext* const pContext)
17241724
}
17251725
}
17261726

1727-
// Note: call reassociation pass before IGCConstProp(EnableSimplifyGEP) to preserve the
1728-
// the expr evaluation order that IGCConstProp creates.
1729-
//
1730-
// Do not apply reordering on VS as CustomUnsafeOptPass does.
1731-
//
1732-
if (IGC_IS_FLAG_ENABLED(EnableReasso) &&
1733-
(pContext->type != ShaderType::VERTEX_SHADER))
1727+
// Note:
1728+
// call reassociation pass before IGCConstProp(EnableSimplifyGEP)
1729+
// to preserve the the expr evaluation order that IGCConstProp
1730+
// creates.
1731+
// Limit this optimization to GPGPU-only because it tends to have
1732+
// more address computation.
1733+
// Do not apply reordering on vertex-shader as CustomUnsafeOptPass
1734+
// does.
1735+
if (IGC_IS_FLAG_ENABLED(OCLEnableReassociate) &&
1736+
pContext->type == ShaderType::OPENCL_SHADER)
17341737
{
17351738
mpm.add(createReassociatePass());
17361739
}

IGC/common/igc_flags.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ DECLARE_IGC_REGKEY(bool, EnableSMRescheduling, false, "Change instructi
326326
DECLARE_IGC_REGKEY(bool, DisableEarlyOutPatterns, false, "Disable optimization trying to create an early out after sampleC messages", false)
327327
DECLARE_IGC_REGKEY(DWORD, EarlyOutPatternSelectPS, 0xff, "Each bit selects a pattern match to enable/disable.", false)
328328
DECLARE_IGC_REGKEY(DWORD, EarlyOutPatternSelectCS, 0x8, "Each bit selects a pattern match to enable/disable.", false)
329-
DECLARE_IGC_REGKEY(bool, EnableReasso, false, "Enable reassociation", false)
329+
DECLARE_IGC_REGKEY(bool, OCLEnableReassociate, false, "Enable reassociation", true)
330330
DECLARE_IGC_REGKEY(bool, EnableOCLScratchPrivateMemory, true, "Enable the use of scratch space for private memory [OCL only]", false)
331331
DECLARE_IGC_REGKEY(bool, EnableMaxWGSizeCalculation, true, "Enable max work group size calculation [OCL only]", true)
332332
DECLARE_IGC_REGKEY(bool, Enable64BitEmulation, false, "Enable 64-bit emulation", false)

0 commit comments

Comments
 (0)