[Mesa-dev] [PATCH 7/8] nir/gcm: Prefer the instruction's original block

Jason Ekstrand jason at jlekstrand.net
Wed Jan 18 02:38:41 UTC 2017


---
 src/compiler/nir/nir_opt_gcm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/compiler/nir/nir_opt_gcm.c b/src/compiler/nir/nir_opt_gcm.c
index 9d61c65..80e34e1 100644
--- a/src/compiler/nir/nir_opt_gcm.c
+++ b/src/compiler/nir/nir_opt_gcm.c
@@ -292,6 +292,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;
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list