[all-commits] [llvm/llvm-project] 9e22a5: [llvm] Support invariant.load on readonly intrinsi...

Krzysztof Drewniak via All-commits all-commits at lists.llvm.org
Tue Jul 7 10:46:45 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9e22a5950e51ace7f50729d7f556ca99d06fa8bb
      https://github.com/llvm/llvm-project/commit/9e22a5950e51ace7f50729d7f556ca99d06fa8bb
  Author: Krzysztof Drewniak <Krzysztof.Drewniak at amd.com>
  Date:   2026-07-07 (Tue, 07 Jul 2026)

  Changed paths:
    M llvm/docs/LangRef.rst
    M llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
    M llvm/lib/Analysis/MemorySSA.cpp
    M llvm/lib/IR/Verifier.cpp
    M llvm/test/Analysis/MemorySSA/invariant-load-intrinsic.ll
    M llvm/test/Transforms/GVN/invariant-load-intrinsic.ll
    M llvm/test/Transforms/InstCombine/invariant-load-like-sink.ll
    M llvm/test/Transforms/Sink/invariant-load.ll
    A llvm/test/Verifier/invariant-load-metadata-invalid.ll

  Log Message:
  -----------
  [llvm] Support invariant.load on readonly intrinsics (#205916)

Update passes and analyses that look at invariant.load (ex. MemorySSA)
to also consider the possibility that `!invariant.load` may be present
on intrinsic calls.

Updates the verifier to indicate that `!invariant.load` is only legal
for loads and readonly intrinsics (and moves the definition of the
metadata out of the definition of `load`).

This has not been extended to arbitrary function calls since it's less
clear what the semantics of !invariant.load on them would be.
Furthermore, extension to read/write intrinsics like memcpy() is planned
as a followup.

This PR also deletes tests that were pre-committed in
https://github.com/llvm/llvm-project/pull/205894 but that become invalid
with the verifier changes in this PR

AI disclosure: I've reviewed the code but all the actual generation was
done by AI.

---------

Co-authored-by: Codex <codex at openai.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list