mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 05:08:08 +02:00
aco/cssa: short-cut some trivial case
If a phi-operand is not flagged as kill, it cannot be coalesced because it interferes with the live-out variable. Also do the regClass check earlier. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30182>
This commit is contained in:
parent
d3e9aef5a2
commit
1d0a12438d
1 changed files with 5 additions and 5 deletions
|
|
@ -328,7 +328,11 @@ bool
|
|||
try_coalesce_copy(cssa_ctx& ctx, copy copy, uint32_t block_idx)
|
||||
{
|
||||
/* we can only coalesce temporaries */
|
||||
if (!copy.op.isTemp())
|
||||
if (!copy.op.isTemp() || !copy.op.isKill())
|
||||
return false;
|
||||
|
||||
/* we can only coalesce copies of the same register class */
|
||||
if (copy.op.regClass() != copy.def.regClass())
|
||||
return false;
|
||||
|
||||
/* try emplace a merge_node for the copy operand */
|
||||
|
|
@ -343,10 +347,6 @@ try_coalesce_copy(cssa_ctx& ctx, copy copy, uint32_t block_idx)
|
|||
op_node.value = copy.op;
|
||||
}
|
||||
|
||||
/* we can only coalesce copies of the same register class */
|
||||
if (copy.op.regClass() != copy.def.regClass())
|
||||
return false;
|
||||
|
||||
/* check if this operand has not yet been coalesced */
|
||||
if (op_node.index == -1u) {
|
||||
merge_set op_set = merge_set{copy.op.getTemp()};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue