Mesa (master): freedreno/ir3: make falsedep use's optional

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Apr 13 21:06:28 UTC 2020


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

Author: Rob Clark <robdclark at chromium.org>
Date:   Sun Apr  5 11:28:42 2020 -0700

freedreno/ir3: make falsedep use's optional

Add option when collecting uses to control whether they include
falsedeps or not.

Signed-off-by: Rob Clark <robdclark at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4440>

---

 src/freedreno/ir3/ir3.c    | 6 ++++--
 src/freedreno/ir3/ir3.h    | 2 +-
 src/freedreno/ir3/ir3_cf.c | 2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/freedreno/ir3/ir3.c b/src/freedreno/ir3/ir3.c
index 48d993a3384..6b6b83b62cf 100644
--- a/src/freedreno/ir3/ir3.c
+++ b/src/freedreno/ir3/ir3.c
@@ -1170,7 +1170,7 @@ ir3_lookup_array(struct ir3 *ir, unsigned id)
 }
 
 void
-ir3_find_ssa_uses(struct ir3 *ir, void *mem_ctx)
+ir3_find_ssa_uses(struct ir3 *ir, void *mem_ctx, bool falsedeps)
 {
 	/* We could do this in a single pass if we can assume instructions
 	 * are always sorted.  Which currently might not always be true.
@@ -1184,7 +1184,9 @@ ir3_find_ssa_uses(struct ir3 *ir, void *mem_ctx)
 		foreach_instr (instr, &block->instr_list) {
 			struct ir3_instruction *src;
 
-			foreach_ssa_src (src, instr) {
+			foreach_ssa_src_n (src, n, instr) {
+				if (__is_false_dep(instr, n) && !falsedeps)
+					continue;
 				if (!src->uses)
 					src->uses = _mesa_pointer_set_create(mem_ctx);
 				_mesa_set_add(src->uses, instr);
diff --git a/src/freedreno/ir3/ir3.h b/src/freedreno/ir3/ir3.h
index c62b35537e4..98146f158a8 100644
--- a/src/freedreno/ir3/ir3.h
+++ b/src/freedreno/ir3/ir3.h
@@ -609,7 +609,7 @@ void ir3_clear_mark(struct ir3 *shader);
 
 unsigned ir3_count_instructions(struct ir3 *ir);
 
-void ir3_find_ssa_uses(struct ir3 *ir, void *mem_ctx);
+void ir3_find_ssa_uses(struct ir3 *ir, void *mem_ctx, bool falsedeps);
 
 #include "util/set.h"
 #define foreach_ssa_use(__use, __instr) \
diff --git a/src/freedreno/ir3/ir3_cf.c b/src/freedreno/ir3/ir3_cf.c
index ad65a5ce187..9875ba4906f 100644
--- a/src/freedreno/ir3/ir3_cf.c
+++ b/src/freedreno/ir3/ir3_cf.c
@@ -141,7 +141,7 @@ ir3_cf(struct ir3 *ir)
 {
 	void *mem_ctx = ralloc_context(NULL);
 
-	ir3_find_ssa_uses(ir, mem_ctx);
+	ir3_find_ssa_uses(ir, mem_ctx, false);
 
 	foreach_block (block, &ir->block_list) {
 		foreach_instr_safe (instr, &block->instr_list) {



More information about the mesa-commit mailing list