[llvm] [AMDGPU] Add waterfall intrinsics (PR #192409)

Sebastian Neubauer via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 16 05:26:43 PDT 2026


https://github.com/Flakebi commented:

To make the intent of these intrinsics clear: The power lies in using a “small” value/index in `amdgcn.waterfall.begin`, but using a different, “larger” value in `amdgcn.waterfall.readfirstlane`.
(The “small” value deterministically leads to the “larger” value, i.e. lanes that have the same “small” value must be guaranteed to have the same “larger” value.)

Waterfall loops inserted in the backend always loop over the “larger” value, which is potentially less efficient. It is hard for the backend to find a fitting “small” value, but it is easy for the frontend.
Therefore these intrinsics are introduced, to let the frontend explicitly specify the “small” value, allowing to generate efficient code without wild and complicate heuristics in the backend to reversely find the “small” index value.

https://github.com/llvm/llvm-project/pull/192409


More information about the llvm-commits mailing list