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

Unified Diff: src/compiler/loop-variable-optimizer.h

Issue 2260153002: [turbofan] Induction variable decrement bound analysis. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@DeleteUnusedVar
Patch Set: Simplify if-else loop Created 4 years, 4 months 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 | « no previous file | src/compiler/loop-variable-optimizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « no previous file | src/compiler/loop-variable-optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698