diff options
author | Daniel Schürmann <[email protected]> | 2020-04-13 13:11:30 +0100 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-04-22 18:23:23 +0000 |
commit | 5b2f628da319cdbc2811ab3964d8031ca962f80c (patch) | |
tree | d9237f81ae92c854d35c847cb50132326c7a0e4f | |
parent | d9f7d1d5cb149cf86667876460fdff2e395c9bb1 (diff) |
aco: create pseudo dummy instruction in RA to be used for live-range splits
Reviewed-by: Rhys Perry <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4573>
-rw-r--r-- | src/amd/compiler/aco_register_allocation.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp index 788e3ab58e3..3857ce40721 100644 --- a/src/amd/compiler/aco_register_allocation.cpp +++ b/src/amd/compiler/aco_register_allocation.cpp @@ -64,6 +64,7 @@ struct ra_ctx { std::unordered_map<unsigned, phi_info> phi_map; std::unordered_map<unsigned, unsigned> affinities; std::unordered_map<unsigned, Instruction*> vectors; + aco_ptr<Instruction> pseudo_dummy; unsigned max_used_sgpr = 0; unsigned max_used_vgpr = 0; std::bitset<64> defs_done; /* see MAX_ARGS in aco_instruction_selection_setup.cpp */ @@ -73,7 +74,10 @@ struct ra_ctx { renames(program->blocks.size()), incomplete_phis(program->blocks.size()), filled(program->blocks.size()), - sealed(program->blocks.size()) {} + sealed(program->blocks.size()) + { + pseudo_dummy.reset(create_instruction<Instruction>(aco_opcode::p_parallelcopy, Format::PSEUDO, 0, 0)); + } }; class RegisterFile { @@ -1198,7 +1202,7 @@ void get_reg_for_operand(ra_ctx& ctx, RegisterFile& register_file, pc_op.setFixed(operand.physReg()); /* find free reg */ - PhysReg reg = get_reg(ctx, register_file, pc_op.getTemp(), parallelcopy, instr); + PhysReg reg = get_reg(ctx, register_file, pc_op.getTemp(), parallelcopy, ctx.pseudo_dummy); Definition pc_def = Definition(PhysReg{reg}, pc_op.regClass()); register_file.clear(pc_op); parallelcopy.emplace_back(pc_op, pc_def); |