summaryrefslogtreecommitdiff
path: root/compiler/optimizing/ssa_liveness_analysis.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2016-01-14 21:25:16 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2016-01-14 21:25:16 +0000
commit947cb4f5582d1f57270b48d3c47ea95e7f9085b5 (patch)
tree6f6aed8f8cca3177b06521a8db6ca845d18623ad /compiler/optimizing/ssa_liveness_analysis.cc
parent7b4199a5fa9f151fbf3af2a34f26d04215a1016c (diff)
parent15bd22849ee6a1ffb3fb3630f686c2870bdf1bbc (diff)
Merge "Implement irreducible loop support in optimizing."
Diffstat (limited to 'compiler/optimizing/ssa_liveness_analysis.cc')
-rw-r--r--compiler/optimizing/ssa_liveness_analysis.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/compiler/optimizing/ssa_liveness_analysis.cc b/compiler/optimizing/ssa_liveness_analysis.cc
index b9d8731cc2..a5609fc466 100644
--- a/compiler/optimizing/ssa_liveness_analysis.cc
+++ b/compiler/optimizing/ssa_liveness_analysis.cc
@@ -273,6 +273,18 @@ void SsaLivenessAnalysis::ComputeLiveRanges() {
}
if (block->IsLoopHeader()) {
+ if (kIsDebugBuild && block->GetLoopInformation()->IsIrreducible()) {
+ // To satisfy our liveness algorithm, we need to ensure loop headers of
+ // irreducible loops do not have any live-in instructions, except constants
+ // and the current method, which can be trivially re-materialized.
+ for (uint32_t idx : live_in->Indexes()) {
+ HInstruction* instruction = GetInstructionFromSsaIndex(idx);
+ DCHECK(instruction->GetBlock()->IsEntryBlock()) << instruction->DebugName();
+ DCHECK(!instruction->IsParameterValue()) << instruction->DebugName();
+ DCHECK(instruction->IsCurrentMethod() || instruction->IsConstant())
+ << instruction->DebugName();
+ }
+ }
size_t last_position = block->GetLoopInformation()->GetLifetimeEnd();
// For all live_in instructions at the loop header, we need to create a range
// that covers the full loop.