 Chromium Code Reviews
 Chromium Code Reviews Issue 749233002:
  [turbofan] Combine Word32And with Int32Add and negative power of two.  (Closed) 
  Base URL: https://chromium.googlesource.com/v8/v8.git@master
    
  
    Issue 749233002:
  [turbofan] Combine Word32And with Int32Add and negative power of two.  (Closed) 
  Base URL: https://chromium.googlesource.com/v8/v8.git@master| Index: src/compiler/machine-operator-reducer.cc | 
| diff --git a/src/compiler/machine-operator-reducer.cc b/src/compiler/machine-operator-reducer.cc | 
| index 6c4d5dcb953725ec4ba114c25c8add56ce7bceef..470e71d6738cf8a2a51d45f767d3ef3fc429144d 100644 | 
| --- a/src/compiler/machine-operator-reducer.cc | 
| +++ b/src/compiler/machine-operator-reducer.cc | 
| @@ -137,6 +137,19 @@ Reduction MachineOperatorReducer::Reduce(Node* node) { | 
| return Changed(node); | 
| } | 
| } | 
| + if (m.left().IsInt32Add() && m.right().IsNegativePowerOf2()) { | 
| + Int32BinopMatcher mleft(m.left().node()); | 
| + if (mleft.right().HasValue() && | 
| + (mleft.right().Value() & m.right().Value()) == | 
| + mleft.right().Value()) { | 
| + // (x + K) & K => (x & K) + K | 
| 
Jarin
2014/11/24 12:28:09
How about (x + K1) & K2 => (x & K2) + K1?
 
Benedikt Meurer
2014/11/24 12:29:33
This was the terminology that we always used here.
 | 
| + return Replace(graph()->NewNode( | 
| + machine()->Int32Add(), | 
| + graph()->NewNode(machine()->Word32And(), mleft.left().node(), | 
| + m.right().node()), | 
| + mleft.right().node())); | 
| 
Jarin
2014/11/24 12:28:09
Funny indentation.
 
Benedikt Meurer
2014/11/24 12:29:33
clang-format...
 | 
| + } | 
| + } | 
| break; | 
| } | 
| case IrOpcode::kWord32Or: { |