From: Rob Clark Date: Sun, 5 Apr 2020 18:28:42 +0000 (-0700) Subject: freedreno/ir3: make falsedep use's optional X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=860f5981f0a0635c301cd856892747ac20f793f5;p=mesa.git 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 Part-of: --- 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) {