How can extract memory dependence among of instructions. I used the following code but it find only one dep for a instruction.I want to get all dependences for an instruction.
MemoryDependenceAnalysis &mda = getAnalysis();
MemDepResult mdr = mda.getDependency(inst);
if (mdr.isDef()) {
Instruction *dep = mdr.getInst();
if (isa(inst)) {
if (isa(dep)) {
//READ AFTER WRITE
}
}
if (isa(inst)) {
if (isa(dep)) {
//WRITE AFTER READ
}
if (isa(dep)) {
//WRITE AFTER WRITE
}
}