ir3: add ir3_aggressive_coalesce helper

To allow us to create merge sets outside of ir3_merge_regs.c.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33319>
This commit is contained in:
Job Noorman
2025-03-14 09:00:04 +01:00
committed by Marge Bot
parent a0db2f9737
commit 0cafd07b0c
2 changed files with 22 additions and 13 deletions
+20 -13
View File
@@ -590,6 +590,25 @@ dump_merge_sets(struct ir3 *ir)
ralloc_free(merge_sets);
}
void
ir3_aggressive_coalesce(struct ir3_liveness *live,
struct ir3_instruction *instr)
{
switch (instr->opc) {
case OPC_META_SPLIT:
aggressive_coalesce_split(live, instr);
break;
case OPC_META_COLLECT:
aggressive_coalesce_collect(live, instr);
break;
case OPC_META_PARALLEL_COPY:
aggressive_coalesce_parallel_copy(live, instr);
break;
default:
break;
}
}
void
ir3_merge_regs(struct ir3_liveness *live, struct ir3 *ir)
{
@@ -606,19 +625,7 @@ ir3_merge_regs(struct ir3_liveness *live, struct ir3 *ir)
/* Second pass: aggressively coalesce parallelcopy, split, collect */
foreach_block (block, &ir->block_list) {
foreach_instr (instr, &block->instr_list) {
switch (instr->opc) {
case OPC_META_SPLIT:
aggressive_coalesce_split(live, instr);
break;
case OPC_META_COLLECT:
aggressive_coalesce_collect(live, instr);
break;
case OPC_META_PARALLEL_COPY:
aggressive_coalesce_parallel_copy(live, instr);
break;
default:
break;
}
ir3_aggressive_coalesce(live, instr);
}
}
+2
View File
@@ -154,6 +154,8 @@ bool ir3_def_live_after(struct ir3_liveness *live, struct ir3_register *def,
void ir3_create_parallel_copies(struct ir3 *ir);
void ir3_merge_regs(struct ir3_liveness *live, struct ir3 *ir);
void ir3_aggressive_coalesce(struct ir3_liveness *live,
struct ir3_instruction *instr);
void ir3_force_merge(struct ir3_register *a, struct ir3_register *b,
int b_offset);