freedreno/ir3: make falsedep use's optional
authorRob Clark <robdclark@chromium.org>
Sun, 5 Apr 2020 18:28:42 +0000 (11:28 -0700)
committerMarge Bot <eric+marge@anholt.net>
Mon, 13 Apr 2020 20:47:28 +0000 (20:47 +0000)
Add option when collecting uses to control whether they include
falsedeps or not.

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

src/freedreno/ir3/ir3.c
src/freedreno/ir3/ir3.h
src/freedreno/ir3/ir3_cf.c

index 48d993a338407bf7f2cfa726e3d31fcaaebfe563..6b6b83b62cfa30a6a364baa7328f2edf189db0e6 100644 (file)
@@ -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);
index c62b35537e4e78c597b447625abe00bbb99fb847..98146f158a8ff3a6f998781a4057c010a1831b47 100644 (file)
@@ -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) \
index ad65a5ce187a443588b7e0429b7899600d0f10dc..9875ba4906f37c540c9cf18ee4033b42fd37c9ee 100644 (file)
@@ -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) {