summaryrefslogtreecommitdiff
path: root/compiler/optimizing/induction_var_analysis.cc
diff options
context:
space:
mode:
author Aart Bik <ajcbik@google.com> 2016-09-16 10:15:19 -0700
committer Aart Bik <ajcbik@google.com> 2016-09-16 14:33:00 -0700
commit009cace65f649000e46a33db26d14b2af8b5aee4 (patch)
tree47d32693b615e35b3cb60ddd54a47e18cccf8200 /compiler/optimizing/induction_var_analysis.cc
parentbe3a3ee02f148345ba6e1a0361532a3f7e8c0002 (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.cc8
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,