aco/ra: use original names when renaming loop carried phi operands

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 7c64623e94 ("aco/ra: refactor SSA repairing during register allocation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10236>
(cherry picked from commit 11fde1247c)
This commit is contained in:
Rhys Perry 2021-04-14 16:02:00 +01:00 committed by Eric Engestrom
parent 170e8ea824
commit 6b385bf6ad
2 changed files with 8 additions and 2 deletions

View file

@ -1579,7 +1579,7 @@
"description": "aco/ra: use original names when renaming loop carried phi operands",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": "7c64623e9489a37297808f7346e6e80bd1c78587"
}

View file

@ -1869,7 +1869,13 @@ void handle_loop_phis(ra_ctx& ctx, const IDSet& live_in,
if (!op.isTemp())
continue;
op.setTemp(read_variable(ctx, op.getTemp(), preds[j]));
/* Find the original name, since this operand might not use the original name if the phi
* was created after init_reg_file().
*/
std::unordered_map<unsigned, Temp>::iterator it = ctx.orig_names.find(op.tempId());
Temp orig = it != ctx.orig_names.end() ? it->second : op.getTemp();
op.setTemp(read_variable(ctx, orig, preds[j]));
op.setFixed(ctx.assignments[op.tempId()].reg);
}
}