summaryrefslogtreecommitdiff
path: root/compiler/optimizing/ssa_liveness_analysis.h
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2015-05-05 17:02:20 +0100
committer Nicolas Geoffray <ngeoffray@google.com> 2015-05-07 09:54:09 +0100
commitdb216f4d49ea1561a74261c29f1264952232728a (patch)
tree8b7914435ad1ba519a3d88b5cca7f0f6e842cd4f /compiler/optimizing/ssa_liveness_analysis.h
parentbc3b93eadd155342b6124d2d5ef3806ecec5dfd6 (diff)
Relax the only one back-edge restriction.
The rule is in the way for better register allocation, as it creates an artificial join point between multiple paths. Change-Id: Ia4392890f95bcea56d143138f28ddce6c572ad58
Diffstat (limited to 'compiler/optimizing/ssa_liveness_analysis.h')
-rw-r--r--compiler/optimizing/ssa_liveness_analysis.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/optimizing/ssa_liveness_analysis.h b/compiler/optimizing/ssa_liveness_analysis.h
index 7b98c4eab5..b550d8ad8e 100644
--- a/compiler/optimizing/ssa_liveness_analysis.h
+++ b/compiler/optimizing/ssa_liveness_analysis.h
@@ -973,7 +973,11 @@ class LiveInterval : public ArenaObject<kArenaAllocMisc> {
break;
}
- size_t back_edge_use_position = current->GetSingleBackEdge()->GetLifetimeEnd();
+ // We're only adding a synthesized use at the last back edge. Adding syntehsized uses on
+ // all back edges is not necessary: anything used in the loop will have its use at the
+ // last back edge. If we want branches in a loop to have better register allocation than
+ // another branch, then it is the linear order we should change.
+ size_t back_edge_use_position = current->GetLifetimeEnd();
if ((first_use_ != nullptr) && (first_use_->GetPosition() <= back_edge_use_position)) {
// There was a use already seen in this loop. Therefore the previous call to `AddUse`
// already inserted the backedge use. We can stop going outward.