diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-08-15 14:22:48 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-08-19 08:32:17 -0700 |
commit | 6f1c8c148d01974f1ea99c59482d92944aaad438 (patch) | |
tree | 8ed2ca047cf97b9fe6f2d86258a8c7e5db419ff2 /src/panfrost/midgard | |
parent | d68019ad1f7c2a448a5ec4f85a261e9cfc2f8944 (diff) |
pan/midgard: Add mir_rewrite_index_dst_single helper
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/panfrost/midgard')
-rw-r--r-- | src/panfrost/midgard/compiler.h | 1 | ||||
-rw-r--r-- | src/panfrost/midgard/mir.c | 9 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h index 1fddd3f1fe8..1cbebdbef2e 100644 --- a/src/panfrost/midgard/compiler.h +++ b/src/panfrost/midgard/compiler.h @@ -478,6 +478,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_dst_tag(compiler_context *ctx, unsigned old, unsigned new, unsigned tag); +void mir_rewrite_index_dst_single(midgard_instruction *ins, 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); void mir_rewrite_index_src_swizzle(compiler_context *ctx, unsigned old, unsigned new, unsigned swizzle); diff --git a/src/panfrost/midgard/mir.c b/src/panfrost/midgard/mir.c index 97921a419f2..9e269629131 100644 --- a/src/panfrost/midgard/mir.c +++ b/src/panfrost/midgard/mir.c @@ -32,6 +32,12 @@ void mir_rewrite_index_src_single(midgard_instruction *ins, unsigned old, unsign } } +void mir_rewrite_index_dst_single(midgard_instruction *ins, unsigned old, unsigned new) +{ + if (ins->ssa_args.dest == old) + ins->ssa_args.dest = new; +} + static unsigned mir_get_swizzle(midgard_instruction *ins, unsigned idx) { @@ -181,8 +187,7 @@ void mir_rewrite_index_dst(compiler_context *ctx, unsigned old, unsigned new) { mir_foreach_instr_global(ctx, ins) { - if (ins->ssa_args.dest == old) - ins->ssa_args.dest = new; + mir_rewrite_index_dst_single(ins, old, new); } } |