[PATCH] D126533: [LAA] Relax pointer dependency with runtime pointer checks

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 6 02:38:23 PDT 2022


sdesmalen added inline comments.


================
Comment at: llvm/lib/Analysis/LoopAccessAnalysis.cpp:1704
+
+    bool SrcAffine = StrideAPtr;
+    if (!SrcAffine && !SrcInvariant && isa<SCEVAddRecExpr>(Src) &&
----------------
I think the expression below is equivalent, because if `Src` is not an affine `SCEVAddRecExpr`, then `StrideAPtr` must be zero?

  bool SrcAffine = !SrcInvariant && isa<SCEVAddRecExpr>(Src) && cast<SCEVAddRecExpr>(Src)->isAffine();


================
Comment at: llvm/lib/Analysis/LoopAccessAnalysis.cpp:1714-1715
+
+    if (APtr != BPtr && (SrcAffine || SinkAffine) &&
+        (SrcInvariant || SinkInvariant))
+      FoundNonConstantDistanceDependence = true;
----------------
This expression doesn't allow the case where `SrcAffine && SinkAffine && !SrcInvariant && !SinkInvariant`.

AIUI the distance can only be computed if:

  (SrcAffine && SinkAffine) ||
  (SrcAffine && SinkInvariant) ||
  (SrcInvariant && SinkAffine) ||
  (SrcInvariant && SinkInvariant)

By the way, I couldn't see any new test-cases. Did you forget to add these, or did I miss something?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126533/new/

https://reviews.llvm.org/D126533



More information about the llvm-commits mailing list