mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2024-12-04 07:34:15 +08:00
aco: store if pseudo instr needs scratch reg
Cc: mesa-stable Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27855>
This commit is contained in:
parent
bd93e8372d
commit
1eb067ee9f
@ -1633,7 +1633,7 @@ static_assert(sizeof(Export_instruction) == sizeof(Instruction) + 4, "Unexpected
|
|||||||
struct Pseudo_instruction : public Instruction {
|
struct Pseudo_instruction : public Instruction {
|
||||||
PhysReg scratch_sgpr; /* might not be valid if it's not needed */
|
PhysReg scratch_sgpr; /* might not be valid if it's not needed */
|
||||||
bool tmp_in_scc;
|
bool tmp_in_scc;
|
||||||
uint8_t padding;
|
bool needs_scratch_reg; /* if scratch_sgpr/scc can be written, initialized by RA. */
|
||||||
};
|
};
|
||||||
static_assert(sizeof(Pseudo_instruction) == sizeof(Instruction) + 4, "Unexpected padding");
|
static_assert(sizeof(Pseudo_instruction) == sizeof(Instruction) + 4, "Unexpected padding");
|
||||||
|
|
||||||
|
@ -1913,6 +1913,7 @@ handle_pseudo(ra_ctx& ctx, const RegisterFile& reg_file, Instruction* instr)
|
|||||||
if (!needs_scratch_reg)
|
if (!needs_scratch_reg)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
instr->pseudo().needs_scratch_reg = true;
|
||||||
instr->pseudo().tmp_in_scc = reg_file[scc];
|
instr->pseudo().tmp_in_scc = reg_file[scc];
|
||||||
|
|
||||||
int reg = ctx.max_used_sgpr;
|
int reg = ctx.max_used_sgpr;
|
||||||
@ -3067,6 +3068,7 @@ register_allocation(Program* program, std::vector<IDSet>& live_out_per_block, ra
|
|||||||
|
|
||||||
handle_pseudo(ctx, tmp_file, pc.get());
|
handle_pseudo(ctx, tmp_file, pc.get());
|
||||||
} else {
|
} else {
|
||||||
|
pc->needs_scratch_reg = sgpr_operands_alias_defs || linear_vgpr;
|
||||||
pc->tmp_in_scc = false;
|
pc->tmp_in_scc = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,6 +133,7 @@ insert_parallelcopies(ssa_elimination_ctx& ctx)
|
|||||||
}
|
}
|
||||||
pc->tmp_in_scc = block.scc_live_out;
|
pc->tmp_in_scc = block.scc_live_out;
|
||||||
pc->scratch_sgpr = scratch_sgpr;
|
pc->scratch_sgpr = scratch_sgpr;
|
||||||
|
pc->needs_scratch_reg = true;
|
||||||
block.instructions.insert(it, std::move(pc));
|
block.instructions.insert(it, std::move(pc));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user