nir/gcm: Prefer the instruction's original block

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4636>
This commit is contained in:
Jason Ekstrand 2017-01-17 18:38:41 -08:00 committed by Marge Bot
parent d4cf2df01a
commit 50a6dd0d65
1 changed files with 2 additions and 0 deletions

View File

@ -279,6 +279,8 @@ gcm_choose_block_for_instr(nir_instr *instr, nir_block *early_block,
if (state->blocks[block->index].loop_depth <
state->blocks[best->index].loop_depth)
best = block;
else if (block == instr->block)
best = block;
if (block == early_block)
break;