nir: Drop infer_non_readable option for nir_opt_access()

Everybody sets it to true now, and the only reason for the option to
exist was to work around a bug that's now been fixed.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19162>
This commit is contained in:
Kenneth Graunke
2022-10-19 04:19:18 -07:00
committed by Marge Bot
parent 1462a61b5d
commit fde99747e9
9 changed files with 2 additions and 12 deletions
+2 -4
View File
@@ -39,7 +39,6 @@
struct access_state {
nir_shader *shader;
bool infer_non_readable;
struct set *vars_written;
struct set *vars_read;
@@ -210,7 +209,7 @@ process_variable(struct access_state *state, nir_variable *var)
access |= ACCESS_NON_WRITEABLE;
}
if (state->infer_non_readable && !(access & ACCESS_NON_READABLE)) {
if (!(access & ACCESS_NON_READABLE)) {
if (is_buffer ? !state->buffers_read : !state->images_read)
access |= ACCESS_NON_READABLE;
else if ((access & ACCESS_RESTRICT) && !_mesa_set_search(state->vars_read, var))
@@ -250,7 +249,7 @@ update_access(struct access_state *state, nir_intrinsic_instr *instr, bool is_bu
if (is_memory_readonly)
access |= ACCESS_NON_WRITEABLE;
if (state->infer_non_readable && is_memory_writeonly)
if (is_memory_writeonly)
access |= ACCESS_NON_READABLE;
if (!(access & ACCESS_VOLATILE) && is_memory_readonly)
access |= ACCESS_CAN_REORDER;
@@ -327,7 +326,6 @@ nir_opt_access(nir_shader *shader, const nir_opt_access_options *options)
{
struct access_state state = {
.shader = shader,
.infer_non_readable = options->infer_non_readable,
.vars_written = _mesa_pointer_set_create(NULL),
.vars_read = _mesa_pointer_set_create(NULL),
};