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

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

Issue 2054343002: [Turbofan] Make operand canonicalization distinguish between FP types. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Clean up. Created 4 years, 6 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
« src/compiler/instruction.h ('K') | « src/compiler/instruction.cc ('k') | no next file » | 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 10429ab28aaa118f6644e6cd3bfaa81da6a51e96..715eb414bbff8288a37b38f9850b67a224735e2a 100644
--- a/src/compiler/move-optimizer.cc
+++ b/src/compiler/move-optimizer.cc
@@ -27,6 +27,22 @@ struct MoveKeyCompare {
typedef ZoneMap<MoveKey, unsigned, MoveKeyCompare> MoveMap;
typedef ZoneSet<InstructionOperand, CompareOperandModuloType> OperandSet;
+bool Blocks(const OperandSet& set, const InstructionOperand& operand) {
+ if (!operand.IsFPRegister()) return set.find(operand) != set.end();
+
+ const LocationOperand& loc = LocationOperand::cast(operand);
+ if (loc.representation() == MachineRepresentation::kFloat64) {
+ return set.find(operand) != set.end() ||
+ set.find(LocationOperand(loc.kind(), loc.location_kind(),
+ MachineRepresentation::kFloat32,
+ loc.register_code())) != set.end();
+ }
+ DCHECK_EQ(MachineRepresentation::kFloat32, loc.representation());
+ return set.find(operand) != set.end() ||
+ set.find(LocationOperand(loc.kind(), loc.location_kind(),
+ MachineRepresentation::kFloat64,
+ loc.register_code())) != set.end();
+}
int FindFirstNonEmptySlot(const Instruction* instr) {
int i = Instruction::FIRST_GAP_POSITION;
@@ -165,7 +181,7 @@ void MoveOptimizer::MigrateMoves(Instruction* to, Instruction* from) {
// destination operands are eligible for being moved down.
for (MoveOperands* move : *from_moves) {
if (move->IsRedundant()) continue;
- if (dst_cant_be.find(move->destination()) == dst_cant_be.end()) {
+ if (!Blocks(dst_cant_be, move->destination())) {
MoveKey key = {move->source(), move->destination()};
move_candidates.insert(key);
}
@@ -180,7 +196,7 @@ void MoveOptimizer::MigrateMoves(Instruction* to, Instruction* from) {
auto current = iter;
++iter;
InstructionOperand src = current->source;
- if (src_cant_be.find(src) != src_cant_be.end()) {
+ if (Blocks(src_cant_be, src)) {
src_cant_be.insert(current->destination);
move_candidates.erase(current);
changed = true;
« src/compiler/instruction.h ('K') | « src/compiler/instruction.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698