v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
loop-variable-optimizer.h
Go to the documentation of this file.
1// Copyright 2016 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_COMPILER_LOOP_VARIABLE_OPTIMIZER_H_
6#define V8_COMPILER_LOOP_VARIABLE_OPTIMIZER_H_
7
11
12namespace v8 {
13namespace internal {
14namespace compiler {
15
16class CommonOperatorBuilder;
17class TFGraph;
18class Node;
19
69
71 public:
72 void Run();
73
75 Zone* zone);
76
80
83
84 private:
86 const int kFirstBackedge = 1;
87
88 struct Constraint {
92
93 bool operator!=(const Constraint& other) const {
94 return left != other.left || kind != other.kind || right != other.right;
95 }
96 };
97
99
100 void VisitBackedge(Node* from, Node* loop);
101 void VisitNode(Node* node);
102 void VisitMerge(Node* node);
103 void VisitLoop(Node* node);
104 void VisitIf(Node* node, bool polarity);
105 void VisitStart(Node* node);
106 void VisitLoopExit(Node* node);
107 void VisitOtherControl(Node* node);
108
109 void AddCmpToLimits(VariableLimits* limits, Node* node,
111
115 void DetectInductionVariables(Node* loop);
116
117 TFGraph* graph() { return graph_; }
119 Zone* zone() { return zone_; }
120
126
128};
129
130} // namespace compiler
131} // namespace internal
132} // namespace v8
133
134#endif // V8_COMPILER_LOOP_VARIABLE_OPTIMIZER_H_
Builtins::Kind kind
Definition builtins.cc:40
void AddLowerBound(Node *bound, ConstraintKind kind)
void AddUpperBound(Node *bound, ConstraintKind kind)
InductionVariable(Node *phi, Node *effect_phi, Node *arith, Node *increment, Node *init_value, Zone *zone, ArithmeticType arithmeticType)
const InductionVariable * FindInductionVariable(Node *node)
void AddCmpToLimits(VariableLimits *limits, Node *node, InductionVariable::ConstraintKind kind, bool polarity)
ZoneMap< int, InductionVariable * > induction_vars_
LoopVariableOptimizer(TFGraph *graph, CommonOperatorBuilder *common, Zone *zone)
const ZoneMap< int, InductionVariable * > & induction_variables()