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

Tingyuan LIANG via llvm-dev llvm-dev at lists.llvm.org
Sun Mar 31 18:08:46 PDT 2019


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190401/433bedeb/attachment.html>


More information about the llvm-dev mailing list