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

Unified Diff: src/compiler/machine-operator-reducer.cc

Issue 1513543003: [turbofan] Make MachineType a pair of enums. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Moar rebase Created 5 years 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/machine-operator.cc ('k') | src/compiler/mips/instruction-selector-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/machine-operator-reducer.cc
diff --git a/src/compiler/machine-operator-reducer.cc b/src/compiler/machine-operator-reducer.cc
index c174da2f7f2d6d3fcbf684749c29be71348ba338..b31784e6ba338507aafb49371388b32c302b399d 100644
--- a/src/compiler/machine-operator-reducer.cc
+++ b/src/compiler/machine-operator-reducer.cc
@@ -600,7 +600,8 @@ Reduction MachineOperatorReducer::ReduceInt32Mod(Node* node) {
1, Int32Sub(zero, Word32And(Int32Sub(zero, dividend), mask)));
node->ReplaceInput(2, Word32And(dividend, mask));
NodeProperties::ChangeOp(
- node, common()->Select(kMachInt32, BranchHint::kFalse));
+ node,
+ common()->Select(MachineRepresentation::kWord32, BranchHint::kFalse));
} else {
Node* quotient = Int32Div(dividend, divisor);
DCHECK_EQ(dividend, node->InputAt(0));
@@ -650,7 +651,7 @@ Reduction MachineOperatorReducer::ReduceTruncateFloat64ToInt32(Node* node) {
if (m.IsChangeInt32ToFloat64()) return Replace(m.node()->InputAt(0));
if (m.IsPhi()) {
Node* const phi = m.node();
- DCHECK_EQ(kRepFloat64, RepresentationOf(OpParameter<MachineType>(phi)));
+ DCHECK_EQ(MachineRepresentation::kFloat64, PhiRepresentationOf(phi->op()));
if (phi->OwnedBy(node)) {
// TruncateFloat64ToInt32[mode](Phi[Float64](x1,...,xn))
// => Phi[Int32](TruncateFloat64ToInt32[mode](x1),
@@ -665,8 +666,9 @@ Reduction MachineOperatorReducer::ReduceTruncateFloat64ToInt32(Node* node) {
if (reduction.Changed()) input = reduction.replacement();
phi->ReplaceInput(i, input);
}
- NodeProperties::ChangeOp(phi,
- common()->Phi(kMachInt32, value_input_count));
+ NodeProperties::ChangeOp(
+ phi,
+ common()->Phi(MachineRepresentation::kWord32, value_input_count));
return Replace(phi);
}
}
@@ -675,15 +677,16 @@ Reduction MachineOperatorReducer::ReduceTruncateFloat64ToInt32(Node* node) {
Reduction MachineOperatorReducer::ReduceStore(Node* node) {
- MachineType const rep =
- RepresentationOf(StoreRepresentationOf(node->op()).machine_type());
+ MachineRepresentation const rep =
+ StoreRepresentationOf(node->op()).machine_type().representation();
Node* const value = node->InputAt(2);
switch (value->opcode()) {
case IrOpcode::kWord32And: {
Uint32BinopMatcher m(value);
- if (m.right().HasValue() &&
- ((rep == kRepWord8 && (m.right().Value() & 0xff) == 0xff) ||
- (rep == kRepWord16 && (m.right().Value() & 0xffff) == 0xffff))) {
+ if (m.right().HasValue() && ((rep == MachineRepresentation::kWord8 &&
+ (m.right().Value() & 0xff) == 0xff) ||
+ (rep == MachineRepresentation::kWord16 &&
+ (m.right().Value() & 0xffff) == 0xffff))) {
node->ReplaceInput(2, m.left().node());
return Changed(node);
}
@@ -691,9 +694,10 @@ Reduction MachineOperatorReducer::ReduceStore(Node* node) {
}
case IrOpcode::kWord32Sar: {
Int32BinopMatcher m(value);
- if (m.left().IsWord32Shl() &&
- ((rep == kRepWord8 && m.right().IsInRange(1, 24)) ||
- (rep == kRepWord16 && m.right().IsInRange(1, 16)))) {
+ if (m.left().IsWord32Shl() && ((rep == MachineRepresentation::kWord8 &&
+ m.right().IsInRange(1, 24)) ||
+ (rep == MachineRepresentation::kWord16 &&
+ m.right().IsInRange(1, 16)))) {
Int32BinopMatcher mleft(m.left().node());
if (mleft.right().Is(m.right().Value())) {
node->ReplaceInput(2, mleft.left().node());
@@ -811,12 +815,14 @@ Reduction MachineOperatorReducer::ReduceWord32Sar(Node* node) {
}
} else if (mleft.left().IsLoad()) {
LoadRepresentation const rep =
- OpParameter<LoadRepresentation>(mleft.left().node());
- if (m.right().Is(24) && mleft.right().Is(24) && rep == kMachInt8) {
+ LoadRepresentationOf(mleft.left().node()->op());
+ if (m.right().Is(24) && mleft.right().Is(24) &&
+ rep == MachineType::Int8()) {
// Load[kMachInt8] << 24 >> 24 => Load[kMachInt8]
return Replace(mleft.left().node());
}
- if (m.right().Is(16) && mleft.right().Is(16) && rep == kMachInt16) {
+ if (m.right().Is(16) && mleft.right().Is(16) &&
+ rep == MachineType::Int16()) {
// Load[kMachInt16] << 16 >> 16 => Load[kMachInt8]
return Replace(mleft.left().node());
}
« no previous file with comments | « src/compiler/machine-operator.cc ('k') | src/compiler/mips/instruction-selector-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698