I am using LAI->getDependences(), It returns a vector of Dependence objects in a Loop.
If the loop is un-analyzable or parallel, an empty list is returned.
for example:
Loop A:
for (int i = 0; i < N; i ++) {
a[i] = c[i] + d[i];
b[i] = c[i] * d[i];
} Loop B:
for (int i = 0; i < N; i++) {
a[b[i]] = c[i] + d[i];
c[i] = c[i - 1] + 1;
}
Loop A is parallel and Loop B has non-simple dependences(LAI bails out) for both the cases we get an empty set of dependences.
Is there an API that can tell if LAI was successful in dependence computation?
I think getMaxSafeDepDistBytes should only be used if canVectorizeMemory is true. It sounds like you might be asking LAI questions it isn’t really built for. If you are interested in information about dependences and do not require runtime-check generation, https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/Analysis/DependenceAnalysis.h might give you the information you need.