diff options
author | 2015-10-28 15:28:08 -0700 | |
---|---|---|
committer | 2015-10-29 13:29:50 -0700 | |
commit | 73f1f3be46652d3f6df61b4234c366ebbf81274a (patch) | |
tree | 0d6c2f9eb2331fd5de5aa4c43ebcb45e857a4682 /compiler/optimizing/induction_var_analysis.cc | |
parent | f7b7f9984da66149e5fe05713845961d7b069a23 (diff) |
Move loop invariant utility to more general place.
Change-Id: I15ebfbf9684f0fcce9e63d078ff8dc1381fd1ca3
Diffstat (limited to 'compiler/optimizing/induction_var_analysis.cc')
-rw-r--r-- | compiler/optimizing/induction_var_analysis.cc | 15 |
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; |