Fix a crash in Dependency Analysis.
authorKarthik Bhat <kv.bhat@samsung.com>
Tue, 10 Mar 2015 13:31:03 +0000 (13:31 +0000)
committerKarthik Bhat <kv.bhat@samsung.com>
Tue, 10 Mar 2015 13:31:03 +0000 (13:31 +0000)
commit5f9683f54fd2655db302ba4c0434ac8b2a3c9cd3
tree826e035633382454c50457506c914c20106fcfe0
parentb02d16e0e73a8ac392fa57f7e518a54e35948d1d
Fix a crash in Dependency Analysis.
This crash in Dependency analysis is because we assume here that in case of UsefulGEP
both source and destination have the same number of operands which may not be true.
This incorrect assumption results in crash while populating Pairs. Fix the same.

This crash was observed during lnt regression for code such as-
  struct s{
    int A[10][10];
    int C[10][10][10];
  } S;
  void dep_constraint_crash_test(int k,int N)  {
     for( int i=0;i<N;i++)
       for( int j=0;j<N;j++)
         S.A[0][0] = S.C[0][0][k];
  }
Review: http://reviews.llvm.org/D8162

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231784 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/DependenceAnalysis.cpp
test/Analysis/DependenceAnalysis/UsefulGEP.ll [new file with mode: 0644]