Index: src/compiler/loop-variable-optimizer.h |
diff --git a/src/compiler/loop-variable-optimizer.h b/src/compiler/loop-variable-optimizer.h |
index c7e82dc6f5bd8e85bc87012cfa9a04a225130f64..a5c1ad448d89433f0e0328c152bc6571e692cebd 100644 |
--- a/src/compiler/loop-variable-optimizer.h |
+++ b/src/compiler/loop-variable-optimizer.h |
@@ -23,6 +23,7 @@ class InductionVariable : public ZoneObject { |
Node* init_value() const { return init_value_; } |
enum ConstraintKind { kStrict, kNonStrict }; |
+ enum ArithmeticType { kAddition, kSubtraction }; |
struct Bound { |
Bound(Node* bound, ConstraintKind kind) : bound(bound), kind(kind) {} |
@@ -33,17 +34,20 @@ class InductionVariable : public ZoneObject { |
const ZoneVector<Bound>& lower_bounds() { return lower_bounds_; } |
const ZoneVector<Bound>& upper_bounds() { return upper_bounds_; } |
+ ArithmeticType Type() { return arithmeticType_; } |
+ |
private: |
friend class LoopVariableOptimizer; |
InductionVariable(Node* phi, Node* arith, Node* increment, Node* init_value, |
- Zone* zone) |
+ Zone* zone, ArithmeticType arithmeticType) |
: phi_(phi), |
arith_(arith), |
increment_(increment), |
init_value_(init_value), |
lower_bounds_(zone), |
- upper_bounds_(zone) {} |
+ upper_bounds_(zone), |
+ arithmeticType_(arithmeticType) {} |
void AddUpperBound(Node* bound, ConstraintKind kind); |
void AddLowerBound(Node* bound, ConstraintKind kind); |
@@ -54,6 +58,7 @@ class InductionVariable : public ZoneObject { |
Node* init_value_; |
ZoneVector<Bound> lower_bounds_; |
ZoneVector<Bound> upper_bounds_; |
+ ArithmeticType arithmeticType_; |
}; |
class LoopVariableOptimizer { |