[LLVMdev] about MemoryDependenceAnalysis usage

Willy WOLFF willy.mh.wolff at gmail.com
Sat May 9 07:06:12 PDT 2015


Hi,

I try to use MemoryDependenceAnalysis in a pass to analyse a simple function:

void fct (int *restrict*restrict M, int *restrict*restrict L) {
S1:    M[1][1] = 1;
S2:    L[2][2] = 2;
}

When I iterate over MemoryDependenceAnalysis on the S2 statement, I get the load instruction for the first depth of the array, that’s ok. But I get also the load and store for the S1 statement.
I assume the restrict keywoard help the alias analysis to found that pointers don’t alias.
The prototype of this function in llvm-ir is:
define void @fct(i32** noalias %M, i32** noalias %L) #0 { ….

Did this noalias attribute say that both pointer of i32** didn’t alias?

Also, when I check wich AliasAnalysis pass is called with —debug-pass=Structure, I see that Memory Dependence Analysis use No Alias Analysis, even if I use -O3 before calling my pass. Can we specify which AlisAnalysis we want to use inside the pass (in getAnalysisUsage method, or somewhere else)?

Regards,
Willy




More information about the llvm-dev mailing list