Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve no-alias analysis to find arrays-of-arrays #11865

Open
mppf opened this issue Dec 11, 2018 · 0 comments
Open

Improve no-alias analysis to find arrays-of-arrays #11865

mppf opened this issue Dec 11, 2018 · 0 comments

Comments

@mppf
Copy link
Member

mppf commented Dec 11, 2018

LCALS uses refs to array-of-arrays. Many LCALS kernels could be faster if the Chapel compiler can emit no-alias hints to LLVM optimizations for these refs.

For example:

config const n = 10;

proc kernel(A) {
  // This pattern comes up in LCALS
  ref A1 = A[1];
  ref A2 = A[2];

  for i in 1..n {
    A1[i] = A2[1] + A2[i];
  }
}

proc main() {
  var A:[1..10] [1..10] int;
  kernel(A);
}

Here one might imagine that the compiler can prove that A1 does not alias A2 because:

  • A stores sub-arrays by value (not by reference / alias / slice)
  • A1 and A2 came from different indices in A

Associated future test: test/analysis/alias/future/ref-to-array-of-arrays.chpl
(added in PR #11779).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant