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

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 31 00:49:09 PDT 2022


dmgreen added a comment.

Is this example from the summary the motivating example?

  struct Arrays {
  double X[128];
  double Y[128];
  double Z[128];
  double D;
  } s1;
  
  void test(Arrays *S, int n) {
    for ( int k=0 ; k<n ; k++ ) {
      S->X[k] = S->D + S->Y[k] * S->Z[k];
    }
  }

GCC seems to pull the invariant load out of the loop without needing any runtime checks: https://godbolt.org/z/PPn4jP1be
Should clang be able to do the same? It seems that GCC thinks that S->X[k] cannot alias with S->D.


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

https://reviews.llvm.org/D126533



More information about the llvm-commits mailing list