Skip to content

LLVM !noalias and !alias.scope metadata

What does this MR do?

  • Add LLVM metadata for instructions to lib-llvm.
  • Add !noalias and !alias.scope metadata to all load / store instructions.
    As described in #9 (closed), there are three scopes: "globals", "heap" and "a_stack". Unlike in that issue, these all share the same domain called "alias". I don't think it is necessary to use a separate domain for each scope. For instance, Julia also uses the same domain for all scopes1.
  • Add alias.icl test case to verify that the annotations are generated for each of these three scopes.

Changes to public APIs

emitInstr as well as the load and store instructions now receive an additional parameter for the metadata.

Author's checklist (required)

  • If bugs have been solved, tests have been added (guidelines)
  • A changelog entry has been added (guidelines)
  • Newly added code is documented (guidelines)
  • Newly added code has a style consistent with the rest of the repository
  • Intermediate commits compile (use git rebase -i main if not)

Related issues

Closes #9 (closed)

  1. https://github.com/JuliaLang/julia/blob/a3cf9b10ec4316ba674361b8630df4f45564e4f4/test/llvmpasses/alloc-opt-pass.ll#L333-L336

Merge request reports

Loading