Hi all,
I am getting the infamous error:
Assertion `ResultPass && "getAnalysis*() called on an analysis that was not " “‘required’ by pass!”’
but i really don’t understand why.
I have:
void InstrumentationPass::getAnalysisUsage(llvm::AnalysisUsage &AU) const {
AU.setPreservesAll();
AU.addRequired();
AU.addRequired()
DetectKernelsPass (ModulePass) is a simple analysis pass that gathers kernel functions. SimplifyGEPPass (FunctionPass) performs some transformations.
InstrumentationPass (ModulePass) is using the others like:
auto kernels = getAnalysis().getKernels();
for ( auto* kernel : kernels)
getAnalysis().runOnFunction(*kernel);
DetectKernelsPass works fine but i am getting the error for SimplifyGEPPass and i can’t figure out why. Are FunctionPasses not supposed to be used inside ModulePasses like that?
I also tried some llvm pass (MemorySSAWrapperPass) but i’m getting the same error:
AnalysisType &llvm::Pass::getAnalysisID(llvm::AnalysisID) const [AnalysisType = llvm::MemorySSAWrapperPass]: Assertion `ResultPass && "getAnalysis*() called on an analysis that was not " “‘required’ by pass!”’ f
I would really appreciate some help with this.
PS. I’m on LLVM 10, building the passes out of tree.
Ees