summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-01-17 18:38:41 -0800
committerMarge Bot <[email protected]>2020-04-20 03:46:29 +0000
commit50a6dd0d6534f802ca36b607ab5a453b531f4d78 (patch)
treeee1917b1cefb19e2256c3a6346c0f276e1a4d423 /src/compiler
parentd4cf2df01a1f7b77660ea849ba552fd5b2d751d6 (diff)
nir/gcm: Prefer the instruction's original block
Reviewed-by: Kenneth Graunke <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4636>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/nir/nir_opt_gcm.c2
1 files changed, 2 insertions, 0 deletions
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;