summaryrefslogtreecommitdiff
path: root/compiler/optimizing/induction_var_analysis.cc
diff options
context:
space:
mode:
author Aart Bik <ajcbik@google.com> 2015-10-29 21:06:17 +0000
committer android-build-merger <android-build-merger@google.com> 2015-10-29 21:06:17 +0000
commitb8f6d7c3360180174276bab7618760724500d148 (patch)
tree1b81ca0d711ca0561e933563aee255b516a4191f /compiler/optimizing/induction_var_analysis.cc
parentf080d1cc9101813bb15d47f9775e32c86868e462 (diff)
parentc65d1f3d26a47e2fce3c3f8872e7942fec23f9b9 (diff)
Merge "Move loop invariant utility to more general place."
am: c65d1f3d26 * commit 'c65d1f3d26a47e2fce3c3f8872e7942fec23f9b9': Move loop invariant utility to more general place.
Diffstat (limited to 'compiler/optimizing/induction_var_analysis.cc')
-rw-r--r--compiler/optimizing/induction_var_analysis.cc15
1 files changed, 1 insertions, 14 deletions
diff --git a/compiler/optimizing/induction_var_analysis.cc b/compiler/optimizing/induction_var_analysis.cc
index b6220fc133..fdf8cc9c1f 100644
--- a/compiler/optimizing/induction_var_analysis.cc
+++ b/compiler/optimizing/induction_var_analysis.cc
@@ -20,19 +20,6 @@
namespace art {
/**
- * Returns true if instruction is invariant within the given loop
- * (instruction is not defined in same or more inner loop).
- */
-static bool IsLoopInvariant(HLoopInformation* loop, HInstruction* instruction) {
- HLoopInformation* other_loop = instruction->GetBlock()->GetLoopInformation();
- if (other_loop != loop && (other_loop == nullptr || !other_loop->IsIn(*loop))) {
- DCHECK(instruction->GetBlock()->Dominates(loop->GetHeader()));
- return true;
- }
- return false;
-}
-
-/**
* Since graph traversal may enter a SCC at any position, an initial representation may be rotated,
* along dependences, viz. any of (a, b, c, d), (d, a, b, c) (c, d, a, b), (b, c, d, a) assuming
* a chain of dependences (mutual independent items may occur in arbitrary order). For proper
@@ -718,7 +705,7 @@ HInductionVarAnalysis::InductionInfo* HInductionVarAnalysis::LookupInfo(HLoopInf
return loop_it->second;
}
}
- if (IsLoopInvariant(loop, instruction)) {
+ if (loop->IsLoopInvariant(instruction, true)) {
InductionInfo* info = CreateInvariantFetch(instruction);
AssignInfo(loop, instruction, info);
return info;