summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/ir3/ir3_flatten.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/freedreno/ir3/ir3_flatten.c')
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3_flatten.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_flatten.c b/src/gallium/drivers/freedreno/ir3/ir3_flatten.c
index 9389227034c..419cd9dfcd4 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_flatten.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_flatten.c
@@ -65,7 +65,7 @@ static struct ir3_register *unwrap(struct ir3_register *reg)
static void ir3_instr_flatten(struct ir3_flatten_ctx *ctx,
struct ir3_instruction *instr)
{
- unsigned i;
+ struct ir3_instruction *src;
/* if we've already visited this instruction, bail now: */
if (ir3_instr_check_mark(instr))
@@ -131,11 +131,8 @@ static void ir3_instr_flatten(struct ir3_flatten_ctx *ctx,
}
/* recursively visit children: */
- for (i = 1; i < instr->regs_count; i++) {
- struct ir3_register *src = instr->regs[i];
- if (src->flags & IR3_REG_SSA)
- ir3_instr_flatten(ctx, src->instr);
- }
+ foreach_ssa_src(src, instr)
+ ir3_instr_flatten(ctx, src);
}
/* return >= 0 is # of phi's flattened, < 0 is error */