[RFC] A New Pass as an Alternative to DependenceAnalysis

Polly could be understood as a frontend for the Integer Set Library. In addition to dependency analysis, ISL also does schedule optimizaton and code generation (~SCEVExpander).

Polly also has PolyhedralInfo which could be used by LLVM transformation passed for its analyses, but is limited in usefulness because Polly likes to select its scope (the outermost loop that it considers worth optimizing, so any SSA values define before the loop are considered invarient, even if surrounded by another top-level loop) itself. It also adds assumption predicates for non-aliasing and non-integer overflow that have to be ensured at runtime, like LoopVersioningLICM. So PolyhedralInfo only returns dependency information when there are no such assumptions, which in practice is rarely the case. Even a simple loop such as

for (unsigned i = 0; i < n; ++i)
  B[i] = A[i + 2];

needs to ensure that A and B do not alias, and n <= UINT_MAX - 2 because otherwise i + 2 overflows. Hence my pessimism that a simplified (but correct) DA might be insufficient.

The equivalent of SCEV expressions in Polly is isl::pw_aff. SCEVExprs are converted to isl_pw_aff using a component called SCEVAffinator, The equivalent of SCEVExpander is IslExprBuilder.