From c1d33eed417a78407d0955b603085f4e521d9edf Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Sat, 16 May 2020 12:08:26 -0700 Subject: [PATCH] freedreno/ir3: make foreach_ssa_src declar cursor ptr Signed-off-by: Rob Clark Part-of: --- src/freedreno/ir3/ir3.c | 2 -- src/freedreno/ir3/ir3.h | 5 +++-- src/freedreno/ir3/ir3_cf.c | 1 - src/freedreno/ir3/ir3_cp.c | 1 - src/freedreno/ir3/ir3_dce.c | 2 -- src/freedreno/ir3/ir3_group.c | 1 - src/freedreno/ir3/ir3_postsched.c | 1 - src/freedreno/ir3/ir3_sched.c | 7 +------ 8 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/freedreno/ir3/ir3.c b/src/freedreno/ir3/ir3.c index 2fe323eaf76..d575ee3ae42 100644 --- a/src/freedreno/ir3/ir3.c +++ b/src/freedreno/ir3/ir3.c @@ -1201,8 +1201,6 @@ ir3_find_ssa_uses(struct ir3 *ir, void *mem_ctx, bool falsedeps) foreach_block (block, &ir->block_list) { foreach_instr (instr, &block->instr_list) { - struct ir3_instruction *src; - foreach_ssa_src_n (src, n, instr) { if (__is_false_dep(instr, n) && !falsedeps) continue; diff --git a/src/freedreno/ir3/ir3.h b/src/freedreno/ir3/ir3.h index 547cf627203..2ce37bccbac 100644 --- a/src/freedreno/ir3/ir3.h +++ b/src/freedreno/ir3/ir3.h @@ -1110,8 +1110,9 @@ static inline bool __is_false_dep(struct ir3_instruction *instr, unsigned n) /* iterator for an instruction's SSA sources (instr), also returns src #: */ #define foreach_ssa_src_n(__srcinst, __n, __instr) \ - foreach_ssa_srcp_n(__srcp, __n, __instr) \ - if ((__srcinst = *__srcp)) + for (struct ir3_instruction *__srcinst = (void *)~0; __srcinst; __srcinst = NULL) \ + foreach_ssa_srcp_n(__srcp, __n, __instr) \ + if ((__srcinst = *__srcp)) /* iterator for an instruction's SSA sources (instr): */ #define foreach_ssa_src(__srcinst, __instr) \ diff --git a/src/freedreno/ir3/ir3_cf.c b/src/freedreno/ir3/ir3_cf.c index 2b35bc5e473..ee717187a99 100644 --- a/src/freedreno/ir3/ir3_cf.c +++ b/src/freedreno/ir3/ir3_cf.c @@ -69,7 +69,6 @@ static void rewrite_uses(struct ir3_instruction *conv, struct ir3_instruction *replace) { foreach_ssa_use (use, conv) { - struct ir3_instruction *src; foreach_ssa_src_n (src, n, use) { if (src == conv) use->regs[n]->instr = replace; diff --git a/src/freedreno/ir3/ir3_cp.c b/src/freedreno/ir3/ir3_cp.c index 7b6c3657631..7023b327150 100644 --- a/src/freedreno/ir3/ir3_cp.c +++ b/src/freedreno/ir3/ir3_cp.c @@ -772,7 +772,6 @@ ir3_cp(struct ir3 *ir, struct ir3_shader_variant *so) */ foreach_block (block, &ir->block_list) { foreach_instr (instr, &block->instr_list) { - struct ir3_instruction *src; /* by the way, we don't account for false-dep's, so the CP * pass should always happen before false-dep's are inserted diff --git a/src/freedreno/ir3/ir3_dce.c b/src/freedreno/ir3/ir3_dce.c index 6c86d6356b8..b97b2190051 100644 --- a/src/freedreno/ir3/ir3_dce.c +++ b/src/freedreno/ir3/ir3_dce.c @@ -36,8 +36,6 @@ static void instr_dce(struct ir3_instruction *instr, bool falsedep) { - struct ir3_instruction *src; - /* don't mark falsedep's as used, but otherwise process them normally: */ if (!falsedep) instr->flags &= ~IR3_INSTR_UNUSED; diff --git a/src/freedreno/ir3/ir3_group.c b/src/freedreno/ir3/ir3_group.c index c9859197a1e..490c2216e66 100644 --- a/src/freedreno/ir3/ir3_group.c +++ b/src/freedreno/ir3/ir3_group.c @@ -142,7 +142,6 @@ restart: static bool instr_find_neighbors(struct ir3_instruction *instr) { - struct ir3_instruction *src; bool progress = false; if (ir3_instr_check_mark(instr)) diff --git a/src/freedreno/ir3/ir3_postsched.c b/src/freedreno/ir3/ir3_postsched.c index 109b96438a9..91283cb5ea1 100644 --- a/src/freedreno/ir3/ir3_postsched.c +++ b/src/freedreno/ir3/ir3_postsched.c @@ -536,7 +536,6 @@ sched_dag_init(struct ir3_postsched_ctx *ctx) */ foreach_instr (instr, &ctx->unscheduled_list) { struct ir3_postsched_node *n = instr->data; - struct ir3_instruction *src; foreach_ssa_src_n (src, i, instr) { if (src->block != instr->block) diff --git a/src/freedreno/ir3/ir3_sched.c b/src/freedreno/ir3/ir3_sched.c index e6241215d1d..bd5471d7f02 100644 --- a/src/freedreno/ir3/ir3_sched.c +++ b/src/freedreno/ir3/ir3_sched.c @@ -195,7 +195,6 @@ schedule(struct ir3_sched_ctx *ctx, struct ir3_instruction *instr) * collect srcs as partially live. */ if (n->collect) { - struct ir3_instruction *src; foreach_ssa_src (src, n->collect) { if (src->block != instr->block) continue; @@ -248,7 +247,6 @@ struct ir3_sched_notes { static bool could_sched(struct ir3_instruction *instr, struct ir3_instruction *src) { - struct ir3_instruction *other_src; foreach_ssa_src (other_src, instr) { /* if dependency not scheduled, we aren't ready yet: */ if ((src != other_src) && !is_scheduled(other_src)) { @@ -413,7 +411,6 @@ static int live_effect(struct ir3_instruction *instr) { struct ir3_sched_node *n = instr->data; - struct ir3_instruction *src; int new_live = n->partially_live ? 0 : dest_regs(instr); int freed_live = 0; @@ -875,7 +872,7 @@ mark_kill_path(struct ir3_instruction *instr) { struct ir3_sched_node *n = instr->data; n->kill_path = true; - struct ir3_instruction *src; + foreach_ssa_src (src, instr) { if (src->block != instr->block) continue; @@ -919,8 +916,6 @@ is_output_only(struct ir3_instruction *instr) static void sched_node_add_deps(struct ir3_instruction *instr) { - struct ir3_instruction *src; - /* Since foreach_ssa_src() already handles false-dep's we can construct * the DAG easily in a single pass. */ -- 2.30.2