DependenceAnalysis currently does not call de-linearization correctly. Fix it based on how de-linearization is called in Delinearization.cpp.
Diff Detail
- Repository
- rL LLVM
Event Timeline
I don't have enough expertise on DependenceAnalysis unfortunately. You'd have to wait for others to chime it.
lib/Analysis/DependenceAnalysis.cpp | ||
---|---|---|
3247–3262 | Can these be const Instruction*? | |
3255 | The code in Delinearization.cpp does this: // Delinearize the memory access as analyzed in all the surrounding loops. // Do not analyze memory accesses outside loops. for (Loop *L = LI->getLoopFor(BB); L != nullptr; L = L->getParentLoop()) { const SCEV *AccessFn = SE->getSCEVAtScope(getPointerOperand(*Inst), L); So it walks up the chain of loops instead of just always using the inner loop. Should something similar be done here? | |
3429 | Am I correct that an alternative way to fix this problem is to call getSCEVAtScope on the SCEVs being passed here? |
lib/Analysis/DependenceAnalysis.cpp | ||
---|---|---|
3247–3262 | Ideally, yes. However, ScalarEvolution::getElementSize() below does not take a const Instruction as its argument. | |
3255 | From what I understand, It doesn't make much sense to do this here since all we need is to see the value's evolution in the innermost loop its defined in. | |
3429 | Yes. Note that getSCEVAtScope needs to be called on "Src" and not "Pair[0].Src". |
@hfinkel Thank you very much for the review. I don't have permission to commit to the repo. Can you please commit this on my behalf?
The code in Delinearization.cpp does this:
So it walks up the chain of loops instead of just always using the inner loop. Should something similar be done here?