Mesa (master): freedreno/ir3: assert that only single address

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Sep 6 00:43:08 UTC 2019


Module: Mesa
Branch: master
Commit: e59bfc820bdf8531c941150de2ea56fb83b6b28f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e59bfc820bdf8531c941150de2ea56fb83b6b28f

Author: Rob Clark <robdclark at chromium.org>
Date:   Mon Sep  2 10:08:37 2019 -0700

freedreno/ir3: assert that only single address

An instruction can reference only a single address register value.
Add an assert to catch bugs.

Also, address value should also be local to the same block as the
instruction.

(The one spot where changing the instruction address is actually legit
needs to clear the address first.)

Signed-off-by: Rob Clark <robdclark at chromium.org>
Reviewed-by: Eric Anholt <eric at anholt.net>

---

 src/freedreno/ir3/ir3.c       | 4 ++++
 src/freedreno/ir3/ir3_sched.c | 1 +
 2 files changed, 5 insertions(+)

diff --git a/src/freedreno/ir3/ir3.c b/src/freedreno/ir3/ir3.c
index 5c049a5936f..feec723abd0 100644
--- a/src/freedreno/ir3/ir3.c
+++ b/src/freedreno/ir3/ir3.c
@@ -1041,6 +1041,10 @@ ir3_instr_set_address(struct ir3_instruction *instr,
 {
 	if (instr->address != addr) {
 		struct ir3 *ir = instr->block->shader;
+
+		debug_assert(!instr->address);
+		debug_assert(instr->block == addr->block);
+
 		instr->address = addr;
 		array_insert(ir, ir->indirects, instr);
 	}
diff --git a/src/freedreno/ir3/ir3_sched.c b/src/freedreno/ir3/ir3_sched.c
index 9a544a8e651..96897f60e92 100644
--- a/src/freedreno/ir3/ir3_sched.c
+++ b/src/freedreno/ir3/ir3_sched.c
@@ -709,6 +709,7 @@ split_addr(struct ir3_sched_ctx *ctx)
 				/* original addr is scheduled, but new one isn't: */
 				new_addr->flags &= ~IR3_INSTR_MARK;
 			}
+			indirect->address = NULL;
 			ir3_instr_set_address(indirect, new_addr);
 		}
 	}




More information about the mesa-commit mailing list