diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-07-24 12:51:51 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-07-25 06:37:22 -0700 |
commit | eedd6c1dd0040c0a3573000003730a8a3f2e4b78 (patch) | |
tree | b2ff28d78cd3810ddd19ab2f4ff34a3c945b2edb | |
parent | 5d5caf10afffa0ff2fc9076d53962ea67fadbb6b (diff) |
pan/midgard: Add mir_rewrite_index_src_tag
Specialized version of a rewrite that only rewrites a certain type of
instruction.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
-rw-r--r-- | src/panfrost/midgard/compiler.h | 1 | ||||
-rw-r--r-- | src/panfrost/midgard/mir.c | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h index 8266c547843..7b231bf85ea 100644 --- a/src/panfrost/midgard/compiler.h +++ b/src/panfrost/midgard/compiler.h @@ -373,6 +373,7 @@ void mir_rewrite_index(compiler_context *ctx, unsigned old, unsigned new); void mir_rewrite_index_src(compiler_context *ctx, unsigned old, unsigned new); void mir_rewrite_index_dst(compiler_context *ctx, unsigned old, unsigned new); void mir_rewrite_index_src_single(midgard_instruction *ins, unsigned old, unsigned new); +void mir_rewrite_index_src_tag(compiler_context *ctx, unsigned old, unsigned new, unsigned tag); bool mir_single_use(compiler_context *ctx, unsigned value); /* MIR printing */ diff --git a/src/panfrost/midgard/mir.c b/src/panfrost/midgard/mir.c index 03a47f44acb..93262f4b13f 100644 --- a/src/panfrost/midgard/mir.c +++ b/src/panfrost/midgard/mir.c @@ -44,6 +44,19 @@ mir_rewrite_index_src(compiler_context *ctx, unsigned old, unsigned new) } void +mir_rewrite_index_src_tag(compiler_context *ctx, unsigned old, unsigned new, unsigned tag) +{ + mir_foreach_instr_global(ctx, ins) { + if (ins->type != tag) + continue; + + mir_rewrite_index_src_single(ins, old, new); + } +} + + + +void mir_rewrite_index_dst(compiler_context *ctx, unsigned old, unsigned new) { mir_foreach_instr_global(ctx, ins) { |