nir: document restriction on load_smem_amd constantness

This came up while reviewing
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29398 ... Possibly
this intrinsic should be renamed to load_smem_constant_amd for consistency with
load_global_constant. But if we're not going to convey constantness in the
intrinsic name, let's at least document the restriction, because NIR's optimizer
relies on it.

(I didn't inspect every call site, but it looks like load_smem_amd is just used
for descriptor loads so there's no bug to fix.)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29743>
This commit is contained in:
Alyssa Rosenzweig
2024-06-16 15:38:15 -04:00
committed by Marge Bot
parent 15257b65c6
commit ae3af4c73a

View File

@@ -1655,6 +1655,10 @@ store("scalar_arg_amd", [], [BASE])
store("vector_arg_amd", [], [BASE])
# src[] = { 32/64-bit base address, 32-bit offset }.
#
# Similar to load_global_constant, the memory accessed must be read-only. This
# restriction justifies the CAN_REORDER flag. Additionally, the base/offset must
# be subgroup uniform.
intrinsic("load_smem_amd", src_comp=[1, 1], dest_comp=0, bit_sizes=[32],
indices=[ALIGN_MUL, ALIGN_OFFSET],
flags=[CAN_ELIMINATE, CAN_REORDER])