From 9401f5397128ddc8dc36de923dd5e6bd4e4b5be4 Mon Sep 17 00:00:00 2001 From: Aart Bik Date: Mon, 28 Sep 2015 16:25:56 -0700 Subject: Implemented trip-count safety information. As shown in the induction analysis presentation, trip-counts need to deal with potential taken/not-taken situations (so that trip-count is either valid in the full loop or just in the loop-body proper) and potential finite/infinite situations (the latter can still be analyzed but may need to run-time test later to guard against the infinite conditions). This CL provides that information. Change-Id: I0445d8e836b80a3614af217ce3e39d766e77b986 --- compiler/optimizing/induction_var_range.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/induction_var_range.h') diff --git a/compiler/optimizing/induction_var_range.h b/compiler/optimizing/induction_var_range.h index 8280c8bedc..dbdd2eedac 100644 --- a/compiler/optimizing/induction_var_range.h +++ b/compiler/optimizing/induction_var_range.h @@ -73,24 +73,29 @@ class InductionVarRange { // Private helper methods. // - HInductionVarAnalysis::InductionInfo* GetTripCount(HLoopInformation* loop, HInstruction* context); + Value GetInduction(HInstruction* context, HInstruction* instruction, bool is_min); static Value GetFetch(HInstruction* instruction, HInductionVarAnalysis::InductionInfo* trip, + bool in_body, bool is_min); - static Value GetVal(HInductionVarAnalysis::InductionInfo* info, HInductionVarAnalysis::InductionInfo* trip, + bool in_body, bool is_min); static Value GetMul(HInductionVarAnalysis::InductionInfo* info1, HInductionVarAnalysis::InductionInfo* info2, HInductionVarAnalysis::InductionInfo* trip, + bool in_body, bool is_min); static Value GetDiv(HInductionVarAnalysis::InductionInfo* info1, HInductionVarAnalysis::InductionInfo* info2, HInductionVarAnalysis::InductionInfo* trip, + bool in_body, bool is_min); + static bool GetConstant(HInductionVarAnalysis::InductionInfo* info, int32_t *value); + static Value AddValue(Value v1, Value v2); static Value SubValue(Value v1, Value v2); static Value MulValue(Value v1, Value v2); -- cgit v1.2.3-59-g8ed1b