diff options
| author | 2016-09-16 10:15:19 -0700 | |
|---|---|---|
| committer | 2016-09-16 14:33:00 -0700 | |
| commit | 009cace65f649000e46a33db26d14b2af8b5aee4 (patch) | |
| tree | 47d32693b615e35b3cb60ddd54a47e18cccf8200 /compiler/optimizing/induction_var_analysis.cc | |
| parent | be3a3ee02f148345ba6e1a0361532a3f7e8c0002 (diff) | |
Minor induction variable analysis changes.
Rationale:
Few extra comments, added replacement of loop control functionality.
All in preparation of bigger loop optimizations CL.
Change-Id: Ie2243c3c8b57b2901654b05fb200e9d80a0cb641
Test: test-art
Diffstat (limited to 'compiler/optimizing/induction_var_analysis.cc')
| -rw-r--r-- | compiler/optimizing/induction_var_analysis.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/optimizing/induction_var_analysis.cc b/compiler/optimizing/induction_var_analysis.cc index 129c2a94b5..c501ccf80f 100644 --- a/compiler/optimizing/induction_var_analysis.cc +++ b/compiler/optimizing/induction_var_analysis.cc @@ -714,10 +714,12 @@ void HInductionVarAnalysis::VisitTripCount(HLoopInformation* loop, case kCondGE: op = kGE; break; default: LOG(FATAL) << "CONDITION UNREACHABLE"; } + // Associate trip count with control instruction, rather than the condition (even + // though it's its use) since former provides a convenient use-free placeholder. + HInstruction* control = loop->GetHeader()->GetLastInstruction(); InductionInfo* taken_test = CreateInvariantOp(op, lower_expr, upper_expr); - AssignInfo(loop, - loop->GetHeader()->GetLastInstruction(), - CreateTripCount(tcKind, trip_count, taken_test, type)); + DCHECK(control->IsIf()); + AssignInfo(loop, control, CreateTripCount(tcKind, trip_count, taken_test, type)); } bool HInductionVarAnalysis::IsTaken(InductionInfo* lower_expr, |