Revert "reg_alloc: Improve performance of HostLocInfo (#112)"

This reverts commit ed4964e8924abfec65d429edcdbb89eb83a17016.

While this may arguably provide a JIT-time benefit, this cannot
possibly provide a runtime benefit.
This commit is contained in:
MerryMage 2017-11-27 17:14:17 +00:00
parent 87c9b0affe
commit e53d00905f
2 changed files with 5 additions and 5 deletions

View File

@ -5,7 +5,6 @@
*/
#include <algorithm>
#include <vector>
#include <xbyak.h>
@ -100,11 +99,12 @@ void HostLocInfo::WriteLock() {
}
void HostLocInfo::AddValue(IR::Inst* inst) {
values.push_front(inst);
values.push_back(inst);
}
void HostLocInfo::EndOfAllocScope() {
values.remove_if([](const auto& inst) { return !inst->HasUses(); });
const auto to_erase = std::remove_if(values.begin(), values.end(), [](const auto& inst) { return !inst->HasUses(); });
values.erase(to_erase, values.end());
is_being_used = false;
is_scratch = false;

View File

@ -7,7 +7,7 @@
#pragma once
#include <array>
#include <forward_list>
#include <vector>
#include <boost/optional.hpp>
#include <xbyak.h>
@ -40,7 +40,7 @@ public:
void EndOfAllocScope();
private:
std::forward_list<IR::Inst*> values;
std::vector<IR::Inst*> values;
bool is_being_used = false;
bool is_scratch = false;
};