Skip to content

Commit 0d6742d

Browse files
fda0igcbot
authored andcommitted
Skip declarations in ResourceAllocator
FunctionsInfo metadata can contain declarations (functions with no body). When ResourceAllocator calls getAnalysis<ExtensionArgAnalysis>(F) on a declaration, LLVM's FPPassManager skips it, so the analysis never runs and findAnalysisPass returns nullptr, triggering an assert. Skip declarations in the runOnModule loop.
1 parent be2f91c commit 0d6742d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

IGC/Compiler/Optimizer/OpenCLPasses/ResourceAllocator/ResourceAllocator.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ bool ResourceAllocator::runOnModule(Module &M) {
5757
MetaDataUtils *pMdUtils = getAnalysis<MetaDataUtilsWrapper>().getMetaDataUtils();
5858
// FunctionsInfo contains kernels only.
5959
for (auto i = pMdUtils->begin_FunctionsInfo(), e = pMdUtils->end_FunctionsInfo(); i != e; ++i) {
60+
if (i->first->isDeclaration())
61+
continue;
6062
runOnFunction(*(i->first));
6163
}
6264

0 commit comments

Comments
 (0)