mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-08 21:30:23 +01:00
nir: fix GCM when GVN enabled
Enabling GVN uncovered a bug where we would crash if the pass
thinking about pushing something into a loop.
Fixes: 6538b3e566 ("nir: add heuristic for instructions in loops with GCM")
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12242>
This commit is contained in:
parent
104aa6b5d1
commit
edfcc4f022
1 changed files with 7 additions and 1 deletions
|
|
@ -395,6 +395,13 @@ static bool
|
|||
set_block_for_loop_instr(struct gcm_state *state, nir_instr *instr,
|
||||
nir_block *block)
|
||||
{
|
||||
/* If the instruction wasn't in a loop to begin with we don't want to push
|
||||
* it down into one.
|
||||
*/
|
||||
nir_loop *loop = state->blocks[instr->block->index].loop;
|
||||
if (loop == NULL)
|
||||
return true;
|
||||
|
||||
if (nir_block_dominates(instr->block, block))
|
||||
return true;
|
||||
|
||||
|
|
@ -402,7 +409,6 @@ set_block_for_loop_instr(struct gcm_state *state, nir_instr *instr,
|
|||
* do{ ... break; } while(true)
|
||||
* Don't move the instruction as it will not help anything.
|
||||
*/
|
||||
nir_loop *loop = state->blocks[instr->block->index].loop;
|
||||
if (loop->info->limiting_terminator == NULL && !loop->info->complex_loop &&
|
||||
nir_block_ends_in_break(nir_loop_last_block(loop)))
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue