diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-07-25 12:28:38 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-07-26 08:37:08 -0700 |
commit | f9e619fa8292f8c1df1237e5205f3710165aa0ed (patch) | |
tree | 299c575ebee311b7a8ad74004f021c394ec64422 /src/panfrost | |
parent | b3cab85606014d137933c88e619a4dc91e21b73a (diff) |
pan/midgard: Add mir_rewrite_dst_tag helper
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/panfrost')
-rw-r--r-- | src/panfrost/midgard/compiler.h | 1 | ||||
-rw-r--r-- | src/panfrost/midgard/mir.c | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h index da3539e62bd..5ce1257bec9 100644 --- a/src/panfrost/midgard/compiler.h +++ b/src/panfrost/midgard/compiler.h @@ -372,6 +372,7 @@ mir_is_alu_bundle(midgard_bundle *bundle) 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_dst_tag(compiler_context *ctx, unsigned old, unsigned new, unsigned tag); 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); diff --git a/src/panfrost/midgard/mir.c b/src/panfrost/midgard/mir.c index 2c449e0684e..2c2d2fc8345 100644 --- a/src/panfrost/midgard/mir.c +++ b/src/panfrost/midgard/mir.c @@ -66,6 +66,20 @@ mir_rewrite_index_dst(compiler_context *ctx, unsigned old, unsigned new) } void +mir_rewrite_index_dst_tag(compiler_context *ctx, unsigned old, unsigned new, unsigned tag) +{ + mir_foreach_instr_global(ctx, ins) { + if (ins->type != tag) + continue; + + if (ins->ssa_args.dest == old) + ins->ssa_args.dest = new; + } +} + + + +void mir_rewrite_index(compiler_context *ctx, unsigned old, unsigned new) { mir_rewrite_index_src(ctx, old, new); |