aco/spill: Store remat list in an std::unordered_map instead of std::map

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11925>
This commit is contained in:
Tony Wasserka 2021-07-15 15:14:41 +02:00 committed by Marge Bot
parent 4a78a05247
commit e60a70dde0

View file

@ -78,7 +78,7 @@ struct spill_ctx {
std::vector<std::pair<RegClass, std::unordered_set<uint32_t>>> interferences;
std::vector<std::vector<uint32_t>> affinities;
std::vector<bool> is_reloaded;
std::map<Temp, remat_info> remat;
std::unordered_map<Temp, remat_info> remat;
std::set<Instruction*> unused_remats;
unsigned wave_size;
@ -309,7 +309,7 @@ should_rematerialize(aco_ptr<Instruction>& instr)
aco_ptr<Instruction>
do_reload(spill_ctx& ctx, Temp tmp, Temp new_name, uint32_t spill_id)
{
std::map<Temp, remat_info>::iterator remat = ctx.remat.find(tmp);
std::unordered_map<Temp, remat_info>::iterator remat = ctx.remat.find(tmp);
if (remat != ctx.remat.end()) {
Instruction* instr = remat->second.instr;
assert((instr->isVOP1() || instr->isSOP1() || instr->isPseudo() || instr->isSOPK()) &&