[llvm-dev] Pass dependency error
Arthur Eubanks via llvm-dev
llvm-dev at lists.llvm.org
Fri Oct 2 10:54:22 PDT 2020
I'm not too familiar with the legacy PM, but perhaps you're missing a
INITIALIZE_PASS_DEPENDENCY?
On Fri, Oct 2, 2020 at 2:00 AM Ees via llvm-dev <llvm-dev at lists.llvm.org>
wrote:
> 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<DetectKernelsPass>();
> AU.addRequired<SimplifyGEPPass>()
>
> 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<DetectKernelsPass>().getKernels();
> for ( auto* kernel : kernels)
> getAnalysis<SimplifyGEPPass>().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
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20201002/f54d4b62/attachment.html>
More information about the llvm-dev
mailing list