Index: src/compiler/machine-operator-reducer.cc |
diff --git a/src/compiler/machine-operator-reducer.cc b/src/compiler/machine-operator-reducer.cc |
index f285b8a0b8e85d8686bfcb2c7a540a626a042246..0bad93c5e4d39eb27107185b8ca6a1e0f5c5273d 100644 |
--- a/src/compiler/machine-operator-reducer.cc |
+++ b/src/compiler/machine-operator-reducer.cc |
@@ -109,6 +109,15 @@ Reduction MachineOperatorReducer::Reduce(Node* node) { |
return ReplaceInt32(m.left().Value() & m.right().Value()); |
} |
if (m.LeftEqualsRight()) return Replace(m.left().node()); // x & x => x |
+ if (m.left().IsWord32And() && m.right().HasValue()) { |
+ Int32BinopMatcher mleft(m.left().node()); |
+ if (mleft.right().HasValue()) { // (x & K) & K => x & K |
+ node->ReplaceInput(0, mleft.left().node()); |
+ node->ReplaceInput( |
+ 1, Int32Constant(m.right().Value() & mleft.right().Value())); |
+ return Changed(node); |
+ } |
+ } |
break; |
} |
case IrOpcode::kWord32Or: { |