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

Dinar Temirbulatov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 4 03:23:04 PDT 2022


dtemirbulatov added inline comments.


================
Comment at: llvm/lib/Analysis/LoopAccessAnalysis.cpp:1681-1698
+    bool SrcInvariant = PSE.getSE()->isLoopInvariant(Src, InnermostLoop);
+    bool SinkInvariant = PSE.getSE()->isLoopInvariant(Sink, InnermostLoop);
+
+    assert(!(StrideAPtr && SrcInvariant) && "Cannot be strided and invariant");
+    assert(!(StrideBPtr && SinkInvariant) && "Cannot be strided and invariant");
+
+    bool SrcAffine = StrideAPtr;
----------------
sdesmalen wrote:
> The code currently sets `FoundNonConstantDistanceDependence = true` if one of the two pointers is affine, but if one of the pointers is not affine (and also not loop-invariant), then there isn't a non-constant dependence distance to check in the SCEV checks. From what I can tell, I think *both* pointers should be either affine or loop invariant. I wasn't able to create a test-case for it from C, but I think there's a hole here that needs fixing (and preferably testing, if you can create one). What do you think?
> 
> This code could also do with some comments and tidying up.
Correct, I have now a testcase with both non-affine nor loop invariants. I will fix that. Thanks for finding this.


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

https://reviews.llvm.org/D126533



More information about the llvm-commits mailing list