aco: improve sub-dword check for sgpr/constant propagation

p_create_vector can have sub-dword operands with a v1 definition.

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5245>
This commit is contained in:
Rhys Perry 2020-05-18 15:26:58 +01:00 committed by Marge Bot
parent 1210e0bd62
commit 9b69ed0bb9

View file

@ -727,11 +727,16 @@ void label_instruction(opt_ctx &ctx, Block& block, aco_ptr<Instruction>& instr)
/* SALU / PSEUDO: propagate inline constants */
if (instr->isSALU() || instr->format == Format::PSEUDO) {
const bool is_subdword = std::any_of(instr->definitions.begin(), instr->definitions.end(),
[] (const Definition& def) { return def.regClass().is_subdword();});
bool is_subdword = false;
// TODO: optimize SGPR and constant propagation for subdword pseudo instructions on gfx9+
if (is_subdword)
continue;
if (instr->format == Format::PSEUDO) {
is_subdword = std::any_of(instr->definitions.begin(), instr->definitions.end(),
[] (const Definition& def) { return def.regClass().is_subdword();});
is_subdword = is_subdword || std::any_of(instr->operands.begin(), instr->operands.end(),
[] (const Operand& op) { return op.hasRegClass() && op.regClass().is_subdword();});
if (is_subdword)
continue;
}
if (info.is_temp() && info.temp.type() == RegType::sgpr) {
instr->operands[i].setTemp(info.temp);