diff options
author | 2015-11-19 17:04:22 -0800 | |
---|---|---|
committer | 2015-12-08 17:02:15 -0800 | |
commit | 4b467ed97bc5886fb800209c0ee94df10163b88d (patch) | |
tree | 13b2d0b144c65e91243f3aa50ce9514276e52c64 /compiler/optimizing/induction_var_analysis.cc | |
parent | eb5ddd7b02ce2d25d4f28f85a13aac628526e1c1 (diff) |
Simplify and rename IsLoopInvariant() test.
Simplify IsLoopInvariant() test. Also rename it to IsDefinedOutOfTheLoop()
so there is no ambiguity for example whether a instruction after the loop counts
as a loop invariant. It's up to the caller to make the interpretation.
Change-Id: I999139032b0e4d815dd1e2276f2bd428cf558686
Diffstat (limited to 'compiler/optimizing/induction_var_analysis.cc')
-rw-r--r-- | compiler/optimizing/induction_var_analysis.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/optimizing/induction_var_analysis.cc b/compiler/optimizing/induction_var_analysis.cc index fdf8cc9c1f..0b7fdf85ea 100644 --- a/compiler/optimizing/induction_var_analysis.cc +++ b/compiler/optimizing/induction_var_analysis.cc @@ -705,7 +705,8 @@ HInductionVarAnalysis::InductionInfo* HInductionVarAnalysis::LookupInfo(HLoopInf return loop_it->second; } } - if (loop->IsLoopInvariant(instruction, true)) { + if (loop->IsDefinedOutOfTheLoop(instruction)) { + DCHECK(instruction->GetBlock()->Dominates(loop->GetPreHeader())); InductionInfo* info = CreateInvariantFetch(instruction); AssignInfo(loop, instruction, info); return info; |