summaryrefslogtreecommitdiff
path: root/compiler/optimizing/induction_var_range.h
diff options
context:
space:
mode:
author Aart Bik <ajcbik@google.com> 2016-10-20 16:14:16 -0700
committer Aart Bik <ajcbik@google.com> 2016-10-24 12:55:48 -0700
commitcc42be074ed15235426cdbcb34f357ead2be2caf (patch)
treed0ac4dca432e1bb26e21634f21ffc3e05db5020e /compiler/optimizing/induction_var_range.h
parenta8188191477b7b5b01a3c4426c51c48cd55f6678 (diff)
Improved induction variable analysis and loop optimizations.
Rationale: Rather than half-baked reconstructing cycles during loop optimizations, this CL passes the SCC computed during induction variable analysis to the loop optimizer (trading some memory for more optimizations). This further improves CaffeineLogic from 6000us down to 4200us (dx) and 2200us to 1690us (jack). Note that this is on top of prior improvements in previous CLs. Also, some narrowing type concerns are taken care of during transfer operations. Test: test-art-host Change-Id: Ice2764811a70073c5014b3a05fb51f39fd2f4c3c
Diffstat (limited to 'compiler/optimizing/induction_var_range.h')
-rw-r--r--compiler/optimizing/induction_var_range.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/optimizing/induction_var_range.h b/compiler/optimizing/induction_var_range.h
index 2f70046a27..034cf32b2d 100644
--- a/compiler/optimizing/induction_var_range.h
+++ b/compiler/optimizing/induction_var_range.h
@@ -136,10 +136,20 @@ class InductionVarRange {
*/
void ReVisit(HLoopInformation* loop) {
induction_analysis_->induction_.erase(loop);
+ for (HInstructionIterator it(loop->GetHeader()->GetPhis()); !it.Done(); it.Advance()) {
+ induction_analysis_->cycles_.erase(it.Current()->AsPhi());
+ }
induction_analysis_->VisitLoop(loop);
}
/**
+ * Lookup an interesting cycle associated with an entry phi.
+ */
+ ArenaSet<HInstruction*>* LookupCycle(HPhi* phi) const {
+ return induction_analysis_->LookupCycle(phi);
+ }
+
+ /**
* Checks if header logic of a loop terminates.
*/
bool IsFinite(HLoopInformation* loop) const;