From: Jason Ekstrand Date: Wed, 18 Jan 2017 02:38:41 +0000 (-0800) Subject: nir/gcm: Prefer the instruction's original block X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=50a6dd0d6534f802ca36b607ab5a453b531f4d78;p=mesa.git nir/gcm: Prefer the instruction's original block Reviewed-by: Kenneth Graunke Part-of: --- diff --git a/src/compiler/nir/nir_opt_gcm.c b/src/compiler/nir/nir_opt_gcm.c index 86432ab1ab5..bdd1c7d2056 100644 --- a/src/compiler/nir/nir_opt_gcm.c +++ b/src/compiler/nir/nir_opt_gcm.c @@ -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;