aco: make program->needs_vcc independent of VCC hints
Totals from 5 (0.00% of 135048) affected shaders: (GFX9) SGPRs: 208 -> 160 (-23.08%) CodeSize: 2700 -> 2692 (-0.30%) Instrs: 533 -> 531 (-0.38%) Latency: 41688 -> 41680 (-0.02%) Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15408>
This commit is contained in:
parent
415a3820fc
commit
b10c4d7dee
|
@ -88,6 +88,21 @@ struct PhiInfo {
|
||||||
uint16_t linear_phi_defs = 0;
|
uint16_t linear_phi_defs = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
bool
|
||||||
|
instr_needs_vcc(Instruction* instr)
|
||||||
|
{
|
||||||
|
if (instr->isVOPC())
|
||||||
|
return true;
|
||||||
|
if (instr->isVOP2() && !instr->isVOP3()) {
|
||||||
|
if (instr->operands.size() == 3 && instr->operands[2].isTemp() &&
|
||||||
|
instr->operands[2].regClass().type() == RegType::sgpr)
|
||||||
|
return true;
|
||||||
|
if (instr->definitions.size() == 2)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
process_live_temps_per_block(Program* program, live& lives, Block* block, unsigned& worklist,
|
process_live_temps_per_block(Program* program, live& lives, Block* block, unsigned& worklist,
|
||||||
std::vector<PhiInfo>& phi_info)
|
std::vector<PhiInfo>& phi_info)
|
||||||
|
@ -111,6 +126,7 @@ process_live_temps_per_block(Program* program, live& lives, Block* block, unsign
|
||||||
if (is_phi(insn))
|
if (is_phi(insn))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
program->needs_vcc |= instr_needs_vcc(insn);
|
||||||
register_demand[idx] = RegisterDemand(new_demand.vgpr, new_demand.sgpr);
|
register_demand[idx] = RegisterDemand(new_demand.vgpr, new_demand.sgpr);
|
||||||
|
|
||||||
/* KILL */
|
/* KILL */
|
||||||
|
@ -118,7 +134,7 @@ process_live_temps_per_block(Program* program, live& lives, Block* block, unsign
|
||||||
if (!definition.isTemp()) {
|
if (!definition.isTemp()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ((definition.isFixed() || definition.hasHint()) && definition.physReg() == vcc)
|
if (definition.isFixed() && definition.physReg() == vcc)
|
||||||
program->needs_vcc = true;
|
program->needs_vcc = true;
|
||||||
|
|
||||||
const Temp temp = definition.getTemp();
|
const Temp temp = definition.getTemp();
|
||||||
|
@ -189,7 +205,7 @@ process_live_temps_per_block(Program* program, live& lives, Block* block, unsign
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Definition& definition = insn->definitions[0];
|
Definition& definition = insn->definitions[0];
|
||||||
if ((definition.isFixed() || definition.hasHint()) && definition.physReg() == vcc)
|
if (definition.isFixed() && definition.physReg() == vcc)
|
||||||
program->needs_vcc = true;
|
program->needs_vcc = true;
|
||||||
const Temp temp = definition.getTemp();
|
const Temp temp = definition.getTemp();
|
||||||
const size_t n = live.erase(temp.id());
|
const size_t n = live.erase(temp.id());
|
||||||
|
|
Loading…
Reference in New Issue