ac/llvm: Add LLVM bug workaround to ac_build_mbcnt_add.
authorTimur Kristóf <timur.kristof@gmail.com>
Thu, 19 May 2022 21:13:28 +0000 (23:13 +0200)
committerMarge Bot <emma+marge@anholt.net>
Fri, 22 Jul 2022 08:17:39 +0000 (08:17 +0000)
commit1e2663b62c241d6389e3f97cb8e104ccdd8d567e
treeb88243f5b99d8071d09b960eaa59c5fcc63a9363
parentc9f8be9d5870de3c4cc5c2729936595288227e1a
ac/llvm: Add LLVM bug workaround to ac_build_mbcnt_add.

LLVM always believes that this instruction's upper bound is the wave
size, regardless of ac_set_range_metadata and regardless of whether
the add source is used.

As a workaround, emit an extra add instruction.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17706>
src/amd/llvm/ac_llvm_build.c