Index: src/compiler/machine-operator-reducer.cc |
diff --git a/src/compiler/machine-operator-reducer.cc b/src/compiler/machine-operator-reducer.cc |
index bb1596f58bd93e74e8467555f6053cf2988dca49..f788cb54bc272e7da48fcda64169997095f7d95a 100644 |
--- a/src/compiler/machine-operator-reducer.cc |
+++ b/src/compiler/machine-operator-reducer.cc |
@@ -250,6 +250,21 @@ Reduction MachineOperatorReducer::Reduce(Node* node) { |
if (m.IsFoldable()) { // K >> K => K |
return ReplaceInt32(m.left().Value() >> m.right().Value()); |
} |
+ if (m.left().IsWord32Shl()) { |
+ Int32BinopMatcher mleft(m.left().node()); |
+ if (mleft.left().IsLoad()) { |
+ LoadRepresentation const rep = |
+ OpParameter<LoadRepresentation>(mleft.left().node()); |
+ if (m.right().Is(24) && mleft.right().Is(24) && rep == kMachInt8) { |
+ // Load[kMachInt8] << 24 >> 24 => Load[kMachInt8] |
+ return Replace(mleft.left().node()); |
+ } |
+ if (m.right().Is(16) && mleft.right().Is(16) && rep == kMachInt16) { |
+ // Load[kMachInt16] << 16 >> 16 => Load[kMachInt8] |
+ return Replace(mleft.left().node()); |
+ } |
+ } |
+ } |
break; |
} |
case IrOpcode::kWord32Ror: { |