nir: Add ACCESS_CAN_SPECULATE
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Fri, 30 Jun 2023 13:10:56 +0000 (09:10 -0400)
committerMarge Bot <emma+marge@anholt.net>
Tue, 10 Oct 2023 13:51:00 +0000 (13:51 +0000)
commit3325b4778af74af218899c25413ad0c14e98cf5a
tree1f27018c006313ffc91777b76f6af0b0cffc3d39
parent01e7ac328fd3458eb9b30c436b70411d57508345
nir: Add ACCESS_CAN_SPECULATE

Determining whether it is safe to hoist a load instruction out of control flow
depends on complex hardware and driver details. Rather than encoding this as
knobs in every NIR pass that wants to do so (notably nir_opt_preamble and
nir_opt_peephole_select), add a per-load ACCESS flag for backends to set.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24011>
src/compiler/nir/nir_print.c
src/compiler/shader_enums.h