aco: use dominance helpers

This makes the passes slightly faster.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30440>
This commit is contained in:
Rhys Perry
2024-07-11 11:42:28 +01:00
committed by Marge Bot
parent d91e634c13
commit d81d5b7d00
2 changed files with 13 additions and 8 deletions
+6 -8
View File
@@ -146,14 +146,12 @@ inline bool
dominates(cssa_ctx& ctx, Temp a, Temp b)
{
assert(defined_after(ctx, b, a));
merge_node& node_a = ctx.merge_node_table[a.id()];
merge_node& node_b = ctx.merge_node_table[b.id()];
unsigned idom = node_b.defined_at;
while (idom > node_a.defined_at)
idom = b.regClass().type() == RegType::vgpr ? ctx.program->blocks[idom].logical_idom
: ctx.program->blocks[idom].linear_idom;
return idom == node_a.defined_at;
Block& parent = ctx.program->blocks[ctx.merge_node_table[a.id()].defined_at];
Block& child = ctx.program->blocks[ctx.merge_node_table[b.id()].defined_at];
if (b.regClass().type() == RegType::vgpr)
return dominates_logical(parent, child);
else
return dominates_linear(parent, child);
}
/* Checks whether some variable is live-out, not considering any phi-uses. */