[PATCH] D46201: [DA] Use SCEV to conclude DVEntry::EQ in some cases.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 4 10:24:32 PDT 2018


fhahn planned changes to this revision.
fhahn added inline comments.


================
Comment at: lib/Analysis/DependenceAnalysis.cpp:3654
+      !SE->isLoopInvariant(DstSCEV, DstL)) {
+    const SCEV *DiffSCEV = SE->getMinusSCEV(SrcSCEV, DstSCEV);
+    if (DiffSCEV->isZero()) {
----------------
tvvikram wrote:
> Even I am facing a similar issue. What happens if the access is something like A[(i + j) * n] = A[(i + j) * n] + 10, where n can be 0. In this case, the dependence would be "*" and not "=" right? Maybe just checking if difference is zero wouldn't be enough but traversing the SCEV to see that it is simple/understandable would be necessary.
Right, thanks for having a look!  `isLoopInvariant` is not enough, looks like we need something like "may be loop invariant" :) I'll update the patch.


https://reviews.llvm.org/D46201





More information about the llvm-commits mailing list