aco/ra: fix phi operand renaming

In case one operand was renamed and another operand came
from an incomplete phi, it could happen, that the original
name was not restored.

This has no impact on the code, but ensures correct SSA
is maintained during RA.

Cc: mesa-stable
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8109>
This commit is contained in:
Daniel Schürmann 2020-12-15 16:21:12 +01:00 committed by Marge Bot
parent e384476d1e
commit b50d3e5760
1 changed files with 5 additions and 0 deletions

View File

@ -1615,6 +1615,11 @@ Temp handle_live_in(ra_ctx& ctx, Temp val, Block* block)
phi->operands[i].setFixed(ctx.assignments[ops[i].id()].reg);
if (ops[i].regClass() == new_val.regClass())
ctx.affinities[new_val.id()] = ops[i].id();
/* make sure the operand gets it's original name in case
* it comes from an incomplete phi */
std::unordered_map<unsigned, phi_info>::iterator it = ctx.phi_map.find(ops[i].id());
if (it != ctx.phi_map.end())
it->second.uses.emplace(phi.get());
}
ctx.assignments.emplace_back();
assert(ctx.assignments.size() == ctx.program->peekAllocationId());