Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Unified Diff: src/compiler/move-optimizer.cc

Issue 1087793002: [turbofan] add MachineType to AllocatedOperand (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: no flag Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/instruction-selector-impl.h ('k') | src/compiler/register-allocator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/move-optimizer.cc
diff --git a/src/compiler/move-optimizer.cc b/src/compiler/move-optimizer.cc
index ea514aaa1351f1577af95cc6d6753990451b66c4..d55005f7680aeb2428e2bece4a10e57403448a52 100644
--- a/src/compiler/move-optimizer.cc
+++ b/src/compiler/move-optimizer.cc
@@ -11,8 +11,18 @@ namespace compiler {
namespace {
typedef std::pair<InstructionOperand, InstructionOperand> MoveKey;
-typedef ZoneMap<MoveKey, unsigned> MoveMap;
-typedef ZoneSet<InstructionOperand> OperandSet;
+
+struct MoveKeyCompare {
+ bool operator()(const MoveKey& a, const MoveKey& b) const {
+ if (a.first.EqualsModuloType(b.first)) {
+ return a.second.CompareModuloType(b.second);
+ }
+ return a.first.CompareModuloType(b.first);
+ }
+};
+
+typedef ZoneMap<MoveKey, unsigned, MoveKeyCompare> MoveMap;
+typedef ZoneSet<InstructionOperand, CompareOperandModuloType> OperandSet;
bool GapsCanMoveOver(Instruction* instr) { return instr->IsNop(); }
@@ -224,10 +234,12 @@ bool IsSlot(const InstructionOperand& op) {
bool LoadCompare(const MoveOperands* a, const MoveOperands* b) {
- if (a->source() != b->source()) return a->source() < b->source();
+ if (!a->source().EqualsModuloType(b->source())) {
+ return a->source().CompareModuloType(b->source());
+ }
if (IsSlot(a->destination()) && !IsSlot(b->destination())) return false;
if (!IsSlot(a->destination()) && IsSlot(b->destination())) return true;
- return a->destination() < b->destination();
+ return a->destination().CompareModuloType(b->destination());
}
} // namespace
@@ -252,7 +264,8 @@ void MoveOptimizer::FinalizeMoves(Instruction* instr) {
MoveOperands* group_begin = nullptr;
for (auto load : loads) {
// New group.
- if (group_begin == nullptr || load->source() != group_begin->source()) {
+ if (group_begin == nullptr ||
+ !load->source().EqualsModuloType(group_begin->source())) {
group_begin = load;
continue;
}
« no previous file with comments | « src/compiler/instruction-selector-impl.h ('k') | src/compiler/register-allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698