summaryrefslogtreecommitdiff
path: root/compiler/optimizing/induction_var_analysis.h
diff options
context:
space:
mode:
author Aart Bik <ajcbik@google.com> 2015-09-04 18:22:11 -0700
committer Aart Bik <ajcbik@google.com> 2015-09-07 10:35:55 -0700
commit471a2034171346dda4539b985b95aa6370531171 (patch)
tree9f04b5dd3169909953ac4e38c106287f12e0bbef /compiler/optimizing/induction_var_analysis.h
parent6b79454092582bea4a72872d04e4bc9f0a48a4b8 (diff)
Simplify loop invariant operations during induction analysis.
Rationale: Saves some memory for nodes that are not really required, and yields slightly more readable debugging strings. Change-Id: I95b64b48869699137b5d49e26eb20091e264de7a
Diffstat (limited to 'compiler/optimizing/induction_var_analysis.h')
-rw-r--r--compiler/optimizing/induction_var_analysis.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/compiler/optimizing/induction_var_analysis.h b/compiler/optimizing/induction_var_analysis.h
index db00f58c7b..180d1f7148 100644
--- a/compiler/optimizing/induction_var_analysis.h
+++ b/compiler/optimizing/induction_var_analysis.h
@@ -100,17 +100,17 @@ class HInductionVarAnalysis : public HOptimization {
return map_.find(instruction) != map_.end();
}
- InductionInfo* NewInvariantOp(InductionOp op, InductionInfo* a, InductionInfo* b) {
+ InductionInfo* CreateInvariantOp(InductionOp op, InductionInfo* a, InductionInfo* b) {
DCHECK(((op != kNeg && a != nullptr) || (op == kNeg && a == nullptr)) && b != nullptr);
- return new (graph_->GetArena()) InductionInfo(kInvariant, op, a, b, nullptr);
+ return CreateSimplifiedInvariant(op, a, b);
}
- InductionInfo* NewInvariantFetch(HInstruction* f) {
+ InductionInfo* CreateInvariantFetch(HInstruction* f) {
DCHECK(f != nullptr);
return new (graph_->GetArena()) InductionInfo(kInvariant, kFetch, nullptr, nullptr, f);
}
- InductionInfo* NewInduction(InductionClass ic, InductionInfo* a, InductionInfo* b) {
+ InductionInfo* CreateInduction(InductionClass ic, InductionInfo* a, InductionInfo* b) {
DCHECK(a != nullptr && b != nullptr);
return new (graph_->GetArena()) InductionInfo(ic, kNop, a, b, nullptr);
}
@@ -145,9 +145,11 @@ class HInductionVarAnalysis : public HOptimization {
// Assign and lookup.
void AssignInfo(HLoopInformation* loop, HInstruction* instruction, InductionInfo* info);
InductionInfo* LookupInfo(HLoopInformation* loop, HInstruction* instruction);
+ InductionInfo* CreateSimplifiedInvariant(InductionOp op, InductionInfo* a, InductionInfo* b);
// Helpers.
static bool InductionEqual(InductionInfo* info1, InductionInfo* info2);
+ static bool IsIntAndGet(InductionInfo* info, int64_t* value);
static std::string InductionToString(InductionInfo* info);
// TODO: fine tune the following data structures, only keep relevant data.