aco/reindex_ssa: replace live_var parameter with boolean

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29713>
This commit is contained in:
Daniel Schürmann 2024-06-13 12:11:59 +02:00 committed by Marge Bot
parent a497d105e3
commit 95967c2ca0
3 changed files with 11 additions and 25 deletions

View file

@ -2095,8 +2095,7 @@ public:
uint32_t peekAllocationId() { return allocationID; }
friend void reindex_ssa(Program* program);
friend void reindex_ssa(Program* program, std::vector<IDSet>& live_out);
friend void reindex_ssa(Program* program, bool update_live_out);
Block* create_and_insert_block()
{

View file

@ -516,7 +516,7 @@ emit_parallelcopies(cssa_ctx& ctx)
void
lower_to_cssa(Program* program)
{
reindex_ssa(program, program->live.live_out);
reindex_ssa(program, true);
cssa_ctx ctx = {program, program->live.live_out};
collect_parallelcopies(ctx);
emit_parallelcopies(ctx);

View file

@ -76,34 +76,21 @@ reindex_program(idx_ctx& ctx, Program* program)
program->temp_rc = ctx.temp_rc;
}
void
update_live_out(idx_ctx& ctx, std::vector<IDSet>& live_out)
{
for (IDSet& set : live_out) {
IDSet new_set;
for (uint32_t id : set)
new_set.insert(ctx.renames[id]);
set = new_set;
}
}
} /* end namespace */
void
reindex_ssa(Program* program)
reindex_ssa(Program* program, bool update_live_out = false)
{
idx_ctx ctx;
reindex_program(ctx, program);
program->allocationID = program->temp_rc.size();
}
void
reindex_ssa(Program* program, std::vector<IDSet>& live_out)
{
idx_ctx ctx;
reindex_program(ctx, program);
update_live_out(ctx, live_out);
if (update_live_out) {
for (IDSet& set : program->live.live_out) {
IDSet new_set;
for (uint32_t id : set)
new_set.insert(ctx.renames[id]);
set = new_set;
}
}
program->allocationID = program->temp_rc.size();
}