From e6bd0272b43bf73faabc64abc9c51ab8ed128308 Mon Sep 17 00:00:00 2001 From: Aart Bik Date: Fri, 16 Dec 2016 13:57:52 -0800 Subject: Improved induction var and range analysis around types. Rationale: Lots of code should not depend on int only. This CL generalizes the kinds of types that can be optimized after analysis. As part of the CL, however, a minor cleanup regarding type safety of the stored induction var analysis results is required. This further improved our int benchmark, and brings the long benchmark up-to-par. Test: m test-art-host-run-test Change-Id: I5dfb623dabf9113de90c2f6da99328dda8f8b60b --- compiler/optimizing/induction_var_analysis.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/induction_var_analysis.h') diff --git a/compiler/optimizing/induction_var_analysis.h b/compiler/optimizing/induction_var_analysis.h index 293aa70525..39b39cdf55 100644 --- a/compiler/optimizing/induction_var_analysis.h +++ b/compiler/optimizing/induction_var_analysis.h @@ -167,7 +167,7 @@ class HInductionVarAnalysis : public HOptimization { InductionInfo* TransferAddSub(InductionInfo* a, InductionInfo* b, InductionOp op); InductionInfo* TransferNeg(InductionInfo* a); InductionInfo* TransferMul(InductionInfo* a, InductionInfo* b); - InductionInfo* TransferCnv(InductionInfo* a, Primitive::Type from, Primitive::Type to); + InductionInfo* TransferConversion(InductionInfo* a, Primitive::Type from, Primitive::Type to); // Solvers. InductionInfo* SolvePhi(HInstruction* phi, size_t input_index, size_t adjust_input_size); @@ -191,7 +191,9 @@ class HInductionVarAnalysis : public HOptimization { HInstruction* entry_phi, HInstruction* instruction, int64_t oppositive_value); - InductionInfo* SolveCnv(HTypeConversion* conversion); + InductionInfo* SolveConversion(HLoopInformation* loop, + HInstruction* entry_phi, + HTypeConversion* conversion); // Trip count information. void VisitControl(HLoopInformation* loop); @@ -235,6 +237,7 @@ class HInductionVarAnalysis : public HOptimization { bool IsAtLeast(InductionInfo* info, /*out*/ int64_t* value); // Helpers. + static bool IsNarrowingLinear(InductionInfo* info); static bool InductionEqual(InductionInfo* info1, InductionInfo* info2); static std::string FetchToString(HInstruction* fetch); static std::string InductionToString(InductionInfo* info); -- cgit v1.2.3-59-g8ed1b