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

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 1 07:23:36 PDT 2022


sdesmalen 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;
----------------
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.


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

https://reviews.llvm.org/D126533



More information about the llvm-commits mailing list