[llvm-dev] Unable to find requested analysis info (Assertion Failture of ScalarEvolutionWrapperPass for Specific Target Source Code)

David Greene via llvm-dev llvm-dev at lists.llvm.org
Wed Apr 3 09:18:26 PDT 2019


See this:

http://lists.llvm.org/pipermail/llvm-dev/2019-March/131346.html

I have also had trouble with function-level analysis passes used by a
ModulePass.  It seems like the legacy pass manager simply doesn't
support it.  It works fine with the new pass manager.

What's scary is that the code compiles just fine but it fails at runtime
(for some codes, as you've observed) because the legacy pass manager
deletes each function analysis pass sometime after getAnalysis is run.

The on-the-fly pass manager systems seems fundamentally broken to me,
though I haven't got any responses on that post that either confirm or
deny that.

                     -David

Tingyuan LIANG via llvm-dev <llvm-dev at lists.llvm.org> writes:

> Dear all,
>
>     Hi! I encounter an interesting assertion failure: (sorry for re-sending the email because I need to add the details of the assertion)
>
>         /usr/local/include/llvm/PassAnalysisSupport.h:262: AnalysisType& llvm::Pass::getAnalysisID(llvm::AnalysisID, llvm::Function&) [with AnalysisType =
> llvm::ScalarEvolutionWrapperPass; llvm::AnalysisID = const void*]: Assertion `ResultPass && "Unable to find requested analysis info"' failed
>
>     when implementing my Pass, which is defined with the member functions shown below:
> ======================My Pass======================================
> bool MYPass::runOnModule(Module &M)
> {
>     for (auto &F : M)
>         {
>             SE = &getAnalysis<ScalarEvolutionWrapperPass>(F).getSE();
>             ......
>         }
>     }
>     return false;
> }
>
> void MYPass::getAnalysisUsage(AnalysisUsage &AU) const
> {
>     AU.setPreservesAll();
>     AU.addRequired<LoopInfoWrapperPass>();
>     AU.addRequired<ScalarEvolutionWrapperPass>();
>     AU.addRequired<LoopAccessLegacyAnalysis>();
>     AU.addRequired<DominatorTreeWrapperPass>();
>     AU.addRequired<OptimizationRemarkEmitterWrapperPass>();   
> }
> ===================================================================
>
>     Then, I got the assert failure when running the pass on the following code
> ======================Target Code with Assertion Failure==============================
> void f ( int A[50][100]) {
>   int N = 100;
>   int M = 50;
>   int B[50][100];
>   for ( int j = 0; j < N; j++ )
>     for ( int i = 0; i < M; i++ )
>       B[i][j]=i;
>   for ( int j = 1; j < N; j++ )
>     for ( int i = 1; i < M; i++ )
>       A[i][j] = i%2? A[i-1][j]:B[i][j];
>   return;
> }
> ======================================================================
>     The thing made this failture interesting is that I got no failure when running the pass on the other code, e.g.
> ===========================Target Code without Assertion Failure=====================================
> void f ( int A[50][100],int B[50][100]) {
>   int N = 100;
>   int M = 50;
>   for ( int j = 0; j < N; j++ )
>     for ( int i = 0; i < M; i++ )
>       B[i][j]=i;
>   for ( int j = 1; j < N; j++ )
>     for ( int i = 1; i < M; i++ )
>       A[i][j] = i%2? A[i-1][j]:B[i][j];
>   return;
> }
>
>     I am confused by this situation because this failure has not occurred before and it shoud not be effected by the target code.
>     Thanks in advance for your time and suggestion!!!^_^
>
> Best regards,
> ------------------------------------------
> Tingyuan LIANG
> MPhil Student
> Department of Electronic and Computer Engineering
> The Hong Kong University of Science and Technology
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


More information about the llvm-dev mailing list