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

Unified Diff: src/compiler/common-operator.cc

Issue 2164263003: [turbofan] Induction variable bound analysis. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 5 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 | « src/compiler/common-operator.h ('k') | src/compiler/loop-analysis.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/common-operator.cc
diff --git a/src/compiler/common-operator.cc b/src/compiler/common-operator.cc
index a1dc7d27f471c405a53d503b1dff1be4a1b3cdfb..bc36c5208bd2b5ad2ab98a0b41896f8aa5d09911 100644
--- a/src/compiler/common-operator.cc
+++ b/src/compiler/common-operator.cc
@@ -276,6 +276,11 @@ std::ostream& operator<<(std::ostream& os,
V(5) \
V(6)
+#define CACHED_INDUCTION_VARIABLE_PHI_LIST(V) \
+ V(4) \
+ V(5) \
+ V(6) \
+ V(7)
#define CACHED_LOOP_LIST(V) \
V(1) \
@@ -473,6 +478,20 @@ struct CommonOperatorGlobalCache final {
CACHED_PHI_LIST(CACHED_PHI)
#undef CACHED_PHI
+ template <int kInputCount>
+ struct InductionVariablePhiOperator final : public Operator {
+ InductionVariablePhiOperator()
+ : Operator( //--
+ IrOpcode::kInductionVariablePhi, Operator::kPure, // opcode
+ "InductionVariablePhi", // name
+ kInputCount, 0, 1, 1, 0, 0) {} // counts
+ };
+#define CACHED_INDUCTION_VARIABLE_PHI(input_count) \
+ InductionVariablePhiOperator<input_count> \
+ kInductionVariablePhi##input_count##Operator;
+ CACHED_INDUCTION_VARIABLE_PHI_LIST(CACHED_INDUCTION_VARIABLE_PHI)
+#undef CACHED_INDUCTION_VARIABLE_PHI
+
template <int kIndex>
struct ParameterOperator final : public Operator1<ParameterInfo> {
ParameterOperator()
@@ -853,6 +872,25 @@ const Operator* CommonOperatorBuilder::EffectPhi(int effect_input_count) {
0, effect_input_count, 1, 0, 1, 0); // counts
}
+const Operator* CommonOperatorBuilder::InductionVariablePhi(int input_count) {
+ DCHECK(input_count >= 4); // There must be always the entry, backedge,
+ // increment and at least one bound.
+ switch (input_count) {
+#define CACHED_INDUCTION_VARIABLE_PHI(input_count) \
+ case input_count: \
+ return &cache_.kInductionVariablePhi##input_count##Operator;
+ CACHED_INDUCTION_VARIABLE_PHI_LIST(CACHED_INDUCTION_VARIABLE_PHI)
+#undef CACHED_INDUCTION_VARIABLE_PHI
+ default:
+ break;
+ }
+ // Uncached.
+ return new (zone()) Operator( // --
+ IrOpcode::kInductionVariablePhi, Operator::kPure, // opcode
+ "InductionVariablePhi", // name
+ input_count, 0, 1, 1, 0, 0); // counts
+}
+
const Operator* CommonOperatorBuilder::BeginRegion(
RegionObservability region_observability) {
switch (region_observability) {
« no previous file with comments | « src/compiler/common-operator.h ('k') | src/compiler/loop-analysis.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698