mirror-llvm-project/mlir/include
Krzysztof Drewniak 188aa82fd8
[AMDGPU] Add ptr.s.buffer.load intrinsic, use it from Clang (#209243)
This commit adds a version of the existing s_buffer_load intrinsic that
more accurately models the memory semantics of the s_buffer_load
instruction, namely that it is, in fact, a memory load.

To preserve the existing behavior that the "nomem" s.buffer.load
intrinsic was using, Clang and MLIR add !invariant.load metadata when
constructing the intrinsic (matching documented requirements on
scalarazable buffer loads) and a late codegen pass adds the metadata
just to be safe.

Tests that were "about" s.buffer.load have been copied to create
versions that use the new intrinsic, as was done for the other
*.ptr.buffer.* operations.

Other tests have been upgraded to use the new intrinsic. This has mainly
resulted in minor instruction ordering changes in prologues, if any
change at all. However, CodeGen/AMDGPU/dagcombine-fma-fmad.ll has seen a
v_fma => v_mad pattern fail to match in one case, I don't know if this
is a real regression.

While I was here, the s_buffer_load => buffer_load fallback has been
updated to preserve cachepolity.

AI disclosure: Primarily AI-written code, but I have at least looked at
and tried to find the worst of the silliness.

---------

Co-authored-by: Codex <codex@openai.com>
2026-07-30 09:27:28 -07:00
..
mlir [AMDGPU] Add ptr.s.buffer.load intrinsic, use it from Clang (#209243) 2026-07-30 09:27:28 -07:00
mlir-c [MLIR][APFloat] Add Type definitions for UE5M3 type (#212712) 2026-07-30 18:45:58 +05:30