Mesa (master): nir/gcm: Prefer the instruction's original block
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Apr 20 04:38:56 UTC 2020
Module: Mesa
Branch: master
Commit: 50a6dd0d6534f802ca36b607ab5a453b531f4d78
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=50a6dd0d6534f802ca36b607ab5a453b531f4d78
Author: Jason Ekstrand <jason at jlekstrand.net>
Date: Tue Jan 17 18:38:41 2017 -0800
nir/gcm: Prefer the instruction's original block
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4636>
---
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 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;
More information about the mesa-commit
mailing list