summaryrefslogtreecommitdiff
path: root/compiler/optimizing/induction_var_analysis.h
diff options
context:
space:
mode:
author Aart Bik <ajcbik@google.com> 2015-09-16 12:50:25 -0700
committer Aart Bik <ajcbik@google.com> 2015-09-23 16:20:53 -0700
commitf475bee067ae0f6dd2a022c823c642265f97b065 (patch)
treea411acce47e6b60ef87bc2f873604aad1d31c318 /compiler/optimizing/induction_var_analysis.h
parent15ed726eae70a479f3179de68a643ef30c777cbb (diff)
Various improvements in finding induction variables.
Rationale: (1) Analyze multi-way phis (requested by Nicolas, Igor, and Mingyao). (2) Analyze trip count for restricted != loops (3) Added unit test for public API of range analysis (static methods were already well-tested). Change-Id: I9285d22d3bb927f141204cc4697ea6fe5120994d
Diffstat (limited to 'compiler/optimizing/induction_var_analysis.h')
-rw-r--r--compiler/optimizing/induction_var_analysis.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/compiler/optimizing/induction_var_analysis.h b/compiler/optimizing/induction_var_analysis.h
index 8eccf925c1..190a0db65c 100644
--- a/compiler/optimizing/induction_var_analysis.h
+++ b/compiler/optimizing/induction_var_analysis.h
@@ -121,26 +121,27 @@ class HInductionVarAnalysis : public HOptimization {
uint32_t VisitDescendant(HLoopInformation* loop, HInstruction* instruction);
void ClassifyTrivial(HLoopInformation* loop, HInstruction* instruction);
void ClassifyNonTrivial(HLoopInformation* loop);
+ InductionInfo* RotatePeriodicInduction(InductionInfo* induction, InductionInfo* last);
// Transfer operations.
- InductionInfo* TransferPhi(InductionInfo* a, InductionInfo* b);
+ InductionInfo* TransferPhi(HLoopInformation* loop, HInstruction* phi, size_t input_index);
InductionInfo* TransferAddSub(InductionInfo* a, InductionInfo* b, InductionOp op);
InductionInfo* TransferMul(InductionInfo* a, InductionInfo* b);
InductionInfo* TransferShl(InductionInfo* a, InductionInfo* b, Primitive::Type type);
InductionInfo* TransferNeg(InductionInfo* a);
// Solvers.
- InductionInfo* SolvePhi(HLoopInformation* loop,
- HInstruction* phi,
- HInstruction* instruction);
+ InductionInfo* SolvePhi(HInstruction* phi, size_t input_index);
+ InductionInfo* SolvePhiAllInputs(HLoopInformation* loop,
+ HInstruction* entry_phi,
+ HInstruction* phi);
InductionInfo* SolveAddSub(HLoopInformation* loop,
- HInstruction* phi,
+ HInstruction* entry_phi,
HInstruction* instruction,
HInstruction* x,
HInstruction* y,
InductionOp op,
bool is_first_call);
- InductionInfo* RotatePeriodicInduction(InductionInfo* induction, InductionInfo* last);
// Trip count information.
void VisitControl(HLoopInformation* loop);
@@ -155,7 +156,7 @@ class HInductionVarAnalysis : public HOptimization {
InductionInfo* stride,
int32_t stride_value,
Primitive::Type type,
- bool is_strict);
+ IfCondition cmp);
// Assign and lookup.
void AssignInfo(HLoopInformation* loop, HInstruction* instruction, InductionInfo* info);