Skip to content

Commit 46b574b

Browse files
pmkippesigcbot
authored andcommitted
Restore shader dumping for old-style passes
If a pass does not have a PassInfo entry it will be included in the shader dump.
1 parent 9f8bf2f commit 46b574b

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

IGC/common/LLVMUtils.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -642,11 +642,16 @@ void IGCPassManager::add(Pass *P)
642642
}
643643

644644
// Skip adding a printer pass for analysis passes.
645-
const PassInfo* PI = Pass::lookupPassInfo(P->getPassID());
646-
bool isAnalysisPass = PI && PI->isAnalysis();
647645
std::string pname(P->getPassName().str());
646+
auto isAnalysisPass = [&]() {
647+
const PassInfo* PI = Pass::lookupPassInfo(P->getPassID());
648+
if (PI && PI->isAnalysis())
649+
return true;
650+
else
651+
return false; // unknown or not an analysis pass
652+
}();
648653

649-
if (PI && !isAnalysisPass && isPrintBefore(P))
654+
if (!isAnalysisPass && isPrintBefore(P))
650655
{
651656
addPrintPass(P, true);
652657
}
@@ -663,7 +668,7 @@ void IGCPassManager::add(Pass *P)
663668
PassManager::add(createTimeStatsIGCPass(m_pContext, m_name + '_' + pname, STATS_COUNTER_END));
664669
}
665670

666-
if (PI && !isAnalysisPass && isPrintAfter(P))
671+
if (!isAnalysisPass && isPrintAfter(P))
667672
{
668673
addPrintPass(P, false);
669674
}

0 commit comments

Comments
 (0)