nir/gcm: Clear out pass_flags before starting
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 20 Jul 2021 20:37:31 +0000 (13:37 -0700)
committerMarge Bot <eric+marge@anholt.net>
Wed, 21 Jul 2021 14:24:00 +0000 (14:24 +0000)
commit436668874a1508edf127be16873c6811fe13a3e6
tree213092f9d0d8d0ea03b24dc2ee732e0485772d61
parent3ab74d0ffa3bb14ef6971d8e9d94514e0ff2671a
nir/gcm: Clear out pass_flags before starting

With this pass enabled in Intel drivers, running shader-db on
shaders/unity/38.shader_test resulted in

Program received signal SIGSEGV, Segmentation fault.
gcm_schedule_early_src (src=0x555555d45348, void_state=0x7fffffffba40) at ../../SOURCE/master/src/compiler/nir/nir_opt_gcm.c:297
297    if (info->early_block->index < src_info->early_block->index)
(gdb) print src_info->early_block
$1 = (nir_block *) 0x0

I tracked this down to an early exit from gcm_schedule_early_instr on
the parent instruction because instr->pass_flags was 0x1c.  That
should be an impossible value for this pass, so I inferred that
pass_flags must have dirt left from some previous pass.

Fixes: 8dfe6f672f4 ("nir/GCM: Use pass_flags instead of bitsets for tracking visited/pinned")

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/597>
src/compiler/nir/nir_opt_gcm.c