aco: Make RA understand WMMA instructions.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24683>
This commit is contained in:
Bas Nieuwenhuizen 2023-07-15 19:43:08 +02:00 committed by Marge Bot
parent 5e7c828c0e
commit d8458c0559

View file

@ -2959,6 +2959,14 @@ register_allocation(Program* program, std::vector<IDSet>& live_out_per_block, ra
parallelcopy, instr);
update_renames(ctx, register_file, parallelcopy, instr, (UpdateRenames)0);
definition->setFixed(reg);
} else if (instr_info.classes[(int)instr->opcode] == instr_class::wmma &&
instr->operands[2].isTemp() && instr->operands[2].isKill() &&
instr->operands[2].regClass() == definition->regClass()) {
/* For WMMA, the dest needs to either be equal to operands[2], or not overlap it.
* Here we set a policy of forcing them the same if operands[2] gets killed (and
* otherwise they don't overlap). This may not be optimal if RA would select a
* different location due to affinity, but that gets complicated very quickly. */
definition->setFixed(instr->operands[2].physReg());
}
if (!definition->isFixed()) {