Skip to content

Commit cdb31b2

Browse files
jhananitigcbot
authored andcommitted
Increasing the LicmMssaNoAccForPromotionCap
LLVM 14 upgrade introduced cap for instruction promotion which caused a regression on some workload. The PR increased the threshold.
1 parent 2b1c0bb commit cdb31b2

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

IGC/Compiler/CISACodeGen/ShaderCodeGen.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,11 @@ void AddLegalizationPasses(CodeGenContext& ctx, IGCPassManager& mpm, PSSignature
505505
if (IGC_IS_FLAG_ENABLED(allowLICM) && ctx.m_retryManager.AllowLICM())
506506
{
507507
mpm.add(createSpecialCasesDisableLICM());
508+
#if LLVM_VERSION_MAJOR >= 14
509+
mpm.add(llvm::createLICMPass(100, 500, true));
510+
#else
508511
mpm.add(llvm::createLICMPass());
512+
#endif
509513
}
510514
mpm.add(llvm::createLoopSimplifyPass());
511515
}
@@ -895,7 +899,11 @@ void AddLegalizationPasses(CodeGenContext& ctx, IGCPassManager& mpm, PSSignature
895899
if (!fastCompile && !highAllocaPressure && !isPotentialHPCKernel && IGC_IS_FLAG_ENABLED(allowLICM) && ctx.m_retryManager.AllowLICM())
896900
{
897901
mpm.add(createSpecialCasesDisableLICM());
898-
mpm.add(createLICMPass());
902+
#if LLVM_VERSION_MAJOR >= 14
903+
mpm.add(llvm::createLICMPass(100, 500, true));
904+
#else
905+
mpm.add(llvm::createLICMPass());
906+
#endif
899907
mpm.add(llvm::createEarlyCSEPass());
900908
}
901909
mpm.add(createAggressiveDCEPass());
@@ -1468,7 +1476,11 @@ void OptimizeIR(CodeGenContext* const pContext)
14681476
mpm.add(createSpecialCasesDisableLICM());
14691477
int licmTh = IGC_GET_FLAG_VALUE(LICMStatThreshold);
14701478
mpm.add(new InstrStatistic(pContext, LICM_STAT, InstrStatStage::BEGIN, licmTh));
1479+
#if LLVM_VERSION_MAJOR >= 14
1480+
mpm.add(llvm::createLICMPass(100, 500, true));
1481+
#else
14711482
mpm.add(llvm::createLICMPass());
1483+
#endif
14721484
mpm.add(new InstrStatistic(pContext, LICM_STAT, InstrStatStage::END, licmTh));
14731485
}
14741486

@@ -1523,7 +1535,11 @@ void OptimizeIR(CodeGenContext* const pContext)
15231535
if (IGC_IS_FLAG_ENABLED(allowLICM) && pContext->m_retryManager.AllowLICM())
15241536
{
15251537
mpm.add(createSpecialCasesDisableLICM());
1538+
#if LLVM_VERSION_MAJOR >= 14
1539+
mpm.add(llvm::createLICMPass(100, 500, true));
1540+
#else
15261541
mpm.add(llvm::createLICMPass());
1542+
#endif
15271543
}
15281544

15291545
// Second unrolling with the same threshold.

0 commit comments

Comments
 (0)