From 7dc96932491dde6b5b58998254d5837dbcbbde03 Mon Sep 17 00:00:00 2001 From: Aart Bik Date: Wed, 12 Oct 2016 10:01:05 -0700 Subject: Recognize XOR-based periodic induction. Rationale: This is a commonly used construct (e.g. x = !x for booleans and x ^= 1 for integers). This CL prepares some upcoming optimizations that exploit such inductions. Change-Id: I46edffb9de1075a836995daf5c2dfff7891f3034 Test: 530-checker-loops2 and induction_var_analysis_test --- compiler/optimizing/induction_var_range.h | 2 ++ 1 file changed, 2 insertions(+) (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 df31e81169..895130064a 100644 --- a/compiler/optimizing/induction_var_range.h +++ b/compiler/optimizing/induction_var_range.h @@ -193,6 +193,8 @@ class InductionVarRange { HInductionVarAnalysis::InductionInfo* trip, bool in_body, bool is_min) const; + Value GetXor(HInductionVarAnalysis::InductionInfo* info1, + HInductionVarAnalysis::InductionInfo* info2) const; Value MulRangeAndConstant(int64_t value, HInductionVarAnalysis::InductionInfo* info, -- cgit v1.2.3-59-g8ed1b