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

Tingyuan LIANG via llvm-dev llvm-dev at lists.llvm.org
Sun Mar 31 14:34:20 PDT 2019


Dear all,

    Hi! I encounter an interesting assertion failure 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/20190331/63fb1f2f/attachment.html>


More information about the llvm-dev mailing list