Skip to content

Commit 0efd329

Browse files
dlei6gpszymich
authored andcommitted
Fixed bug that disables AddressArithmeticSinking
With update of retry mechanism to per-function level optimization, AddressArithmeticSinking was not being enabled properly. This fix allows AddressArithmeticSinking to run correctly when enabled.
1 parent 1e90674 commit 0efd329

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

IGC/Compiler/CISACodeGen/AddressArithmeticSinking.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ FunctionPass(ID), m_SinkingDepth(SinkingDepth)
5252
bool AddressArithmeticSinking::runOnFunction(Function& F)
5353
{
5454
auto ctx = getAnalysis<CodeGenContextWrapper>().getCodeGenContext();
55-
if (isOptDisabledForFunction(ctx->getModuleMetaData(), getPassName(), &F))
55+
if (IGC_IS_FLAG_DISABLED(ForceAddressArithSinking) &&
56+
isOptDisabledForFunction(ctx->getModuleMetaData(), getPassName(), &F))
5657
return false;
5758

5859
DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();

IGC/Compiler/CISACodeGen/ShaderCodeGen.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -816,8 +816,7 @@ void AddLegalizationPasses(CodeGenContext& ctx, IGCPassManager& mpm, PSSignature
816816
mpm.add(createAggressiveDCEPass());
817817
// As DPC++ FE apply LICM we cannot reduce register pressure just
818818
// by turning off LICM at IGC in some cases so apply sinking address arithmetic
819-
if (IGC_IS_FLAG_ENABLED(ForceAddressArithSinking) &&
820-
ctx.type == ShaderType::OPENCL_SHADER)
819+
if (ctx.type == ShaderType::OPENCL_SHADER)
821820
{
822821
mpm.add(new AddressArithmeticSinking());
823822
}

0 commit comments

Comments
 (0)