brw: Allow CSE of MEMORY_MODE_CONSTANT loads

This matches the behavior of FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32888>
This commit is contained in:
Kenneth Graunke 2025-01-02 01:27:07 -08:00 committed by Marge Bot
parent 7ce66e2b61
commit 36d0485ae4

View file

@ -121,6 +121,8 @@ is_expression(const fs_visitor *v, const fs_inst *const inst)
case SHADER_OPCODE_COS:
case SHADER_OPCODE_LOAD_SUBGROUP_INVOCATION:
return true;
case SHADER_OPCODE_MEMORY_LOAD_LOGICAL:
return inst->src[MEMORY_LOGICAL_MODE].ud == MEMORY_MODE_CONSTANT;
case SHADER_OPCODE_LOAD_PAYLOAD:
return !is_coalescing_payload(v->devinfo, v->alloc, inst);
default: