Skip to content

Commit 4f4fab7

Browse files
mmereckiigcbot
authored andcommitted
Execute SplitIndirectEEtoSelPass earlier
Execute SplitIndirectEEtoSelPass right after LowerGEPForPrivMemPass
1 parent bb946ee commit 4f4fab7

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

IGC/Compiler/CISACodeGen/ShaderCodeGen.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -640,10 +640,17 @@ void AddLegalizationPasses(CodeGenContext& ctx, IGCPassManager& mpm, PSSignature
640640
}
641641
else
642642
{
643-
if (IGC_IS_FLAG_ENABLED(AllowMem2Reg))
643+
if (IGC_IS_FLAG_ENABLED(AllowMem2Reg))
644644
mpm.add(createPromoteMemoryToRegisterPass());
645645
}
646646

647+
// There's no particular reason for this exact place, but it should be after LowerGEPForPrivMem
648+
if (IGC_IS_FLAG_ENABLED(EnableSplitIndirectEEtoSel))
649+
{
650+
mpm.add(createSplitIndirectEEtoSelPass());
651+
}
652+
653+
647654
if (ctx.type == ShaderType::OPENCL_SHADER ||
648655
ctx.type == ShaderType::COMPUTE_SHADER)
649656
{
@@ -823,12 +830,6 @@ void AddLegalizationPasses(CodeGenContext& ctx, IGCPassManager& mpm, PSSignature
823830
// Since we don't support switch statements, switch lowering is needed after the last CFG simplication
824831
mpm.add(llvm::createLowerSwitchPass());
825832

826-
// There's no particular reason for this exact place, but it should be after LowerGEPForPrivMem
827-
if (IGC_IS_FLAG_ENABLED(EnableSplitIndirectEEtoSel))
828-
{
829-
mpm.add(createSplitIndirectEEtoSelPass());
830-
}
831-
832833
// This pass can create constant expression
833834
if (ctx.m_DriverInfo.HasDoubleLoadStore())
834835
{

0 commit comments

Comments
 (0)