Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Unified Diff: src/IceOperand.cpp

Issue 627203002: Subzero: Optimize live range overlaps() computation through trimming. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Make overlap() conservative by default Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceOperand.h ('k') | src/IceRegAlloc.h » ('j') | src/IceRegAlloc.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceOperand.cpp
diff --git a/src/IceOperand.cpp b/src/IceOperand.cpp
index c366dd993558f604ff6ddf7b441b5350e7c5a36c..ef163d0ee173b8f05b98f6de117aa12c11ca3a6e 100644
--- a/src/IceOperand.cpp
+++ b/src/IceOperand.cpp
@@ -105,9 +105,11 @@ bool LiveRange::endsBefore(const LiveRange &Other) const {
}
// Returns true if there is any overlap between the two live ranges.
-bool LiveRange::overlaps(const LiveRange &Other) const {
+bool LiveRange::overlaps(const LiveRange &Other, bool UseTrimmed) const {
// Do a two-finger walk through the two sorted lists of segments.
- RangeType::const_iterator I1 = Range.begin(), I2 = Other.Range.begin();
+ RangeType::const_iterator I1 = (UseTrimmed ? TrimmedBegin : Range.begin()),
+ I2 = (UseTrimmed ? Other.TrimmedBegin
+ : Other.Range.begin());
RangeType::const_iterator E1 = Range.end(), E2 = Other.Range.end();
while (I1 != E1 && I2 != E2) {
if (I1->second <= I2->first) {
@@ -158,6 +160,11 @@ bool LiveRange::containsValue(InstNumberT Value) const {
return false;
}
+void LiveRange::trim(InstNumberT Lower) {
+ while (TrimmedBegin != Range.end() && TrimmedBegin->second <= Lower)
jvoung (off chromium) 2014/10/05 20:34:13 I might be reading this wrong, but it looks like t
Jim Stichnoth 2014/10/06 13:38:01 Are you asking e.g. what would happen if "this" li
jvoung (off chromium) 2014/10/06 21:57:26 Okay, I see I think I was confused by the order of
+ ++TrimmedBegin;
+}
+
IceString Variable::getName() const {
if (!Name.empty())
return Name;
« no previous file with comments | « src/IceOperand.h ('k') | src/IceRegAlloc.h » ('j') | src/IceRegAlloc.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698