From 0c75e42d5343ddf0cc80497f3a69560c2465988e Mon Sep 17 00:00:00 2001 From: "Kwasniewski, Patryk" Date: Mon, 23 Sep 2024 12:22:42 +0000 Subject: [PATCH] enable IndVarSimplification pass enable IndVarSimplification pass --- IGC/Compiler/CISACodeGen/ShaderCodeGen.cpp | 3 ++- IGC/common/igc_flags.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/IGC/Compiler/CISACodeGen/ShaderCodeGen.cpp b/IGC/Compiler/CISACodeGen/ShaderCodeGen.cpp index c863cfb4cd5e..347c4411ff7c 100644 --- a/IGC/Compiler/CISACodeGen/ShaderCodeGen.cpp +++ b/IGC/Compiler/CISACodeGen/ShaderCodeGen.cpp @@ -1537,7 +1537,8 @@ void OptimizeIR(CodeGenContext* const pContext) mpm.add(createIGCInstructionCombiningPass()); - if (IGC_IS_FLAG_ENABLED(EnableIndVarSimplification)) + if (IGC_IS_FLAG_ENABLED(EnableIndVarSimplification) && + pContext->type == ShaderType::OPENCL_SHADER) { mpm.add(llvm::createIndVarSimplifyPass()); } diff --git a/IGC/common/igc_flags.h b/IGC/common/igc_flags.h index bf508fde109b..de2a2a5b97aa 100644 --- a/IGC/common/igc_flags.h +++ b/IGC/common/igc_flags.h @@ -210,7 +210,7 @@ DECLARE_IGC_REGKEY(bool, DisableIRVerification, false, "Setting this to DECLARE_IGC_REGKEY(bool, EnableJumpThreading, true, "Setting this to 1/true adds a compiler switch to enable llvm jumpThreading pass.", true) DECLARE_IGC_REGKEY(bool, DisableLoopUnroll, false, "Setting this to 1/true adds a compiler switch to disable loop unrolling.", true) DECLARE_IGC_REGKEY(DWORD, RuntimeLoopUnrolling, 0, "Setting this to switch on/off runtime loop unrolling. 0: default (on), 1: force on, 2: force off", false) -DECLARE_IGC_REGKEY(bool, EnableIndVarSimplification, false, "Enables IndVarSimplification pass.", true) +DECLARE_IGC_REGKEY(bool, EnableIndVarSimplification, true, "Enables IndVarSimplification pass.", true) DECLARE_IGC_REGKEY(bool, DisableBranchSwaping, false, "Setting this to 1/true adds a compiler switch to disable branch swapping.", false) DECLARE_IGC_REGKEY(bool, DisableSynchronizationObjectCoalescingPass, false, "Disable SynchronizationObjectCoalescing pass", false) DECLARE_IGC_REGKEY(bool, EnableIndependentSharedMemoryFenceFunctionality, false, "Enable treating global memory fences as shared memory fences in SynchronizationObjectCoalescing pass", false)