Specialized version of a rewrite that only rewrites a certain type of
instruction.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
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 */
}
}
+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)
{