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

Unified Diff: src/IceRegAlloc.h

Issue 642603005: Subzero: Translation-time improvements in the register allocator. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes 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 | « no previous file | src/IceRegAlloc.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceRegAlloc.h
diff --git a/src/IceRegAlloc.h b/src/IceRegAlloc.h
index 2dd9dac99303ba27987005e8d4991242e0f67cc3..f181a27b396824d3bffcb2f0c33031f8d8ca6a01 100644
--- a/src/IceRegAlloc.h
+++ b/src/IceRegAlloc.h
@@ -41,12 +41,12 @@ public:
const bool UseTrimmed = true;
return range().overlapsInst(Other.range().getStart(), UseTrimmed);
}
- Variable *const Var;
+ Variable *Var;
void dump(const Cfg *Func) const;
private:
// LiveRangeWrapper(const LiveRangeWrapper &) = delete;
- LiveRangeWrapper &operator=(const LiveRangeWrapper &) = delete;
+ // LiveRangeWrapper &operator=(const LiveRangeWrapper &) = delete;
};
class LinearScan {
@@ -57,20 +57,7 @@ public:
private:
Cfg *const Func;
- // RangeCompare is the comparator for sorting an LiveRangeWrapper
- // by starting point in a std::set<>. Ties are broken by variable
- // number so that sorting is stable.
- struct RangeCompare {
- bool operator()(const LiveRangeWrapper &L,
- const LiveRangeWrapper &R) const {
- InstNumberT Lstart = L.Var->getLiveRange().getStart();
- InstNumberT Rstart = R.Var->getLiveRange().getStart();
- if (Lstart == Rstart)
- return L.Var->getIndex() < R.Var->getIndex();
- return Lstart < Rstart;
- }
- };
- typedef std::set<LiveRangeWrapper, RangeCompare> OrderedRanges;
+ typedef std::vector<LiveRangeWrapper> OrderedRanges;
typedef std::list<LiveRangeWrapper> UnorderedRanges;
OrderedRanges Unhandled;
// UnhandledPrecolored is a subset of Unhandled, specially collected
« no previous file with comments | « no previous file | src/IceRegAlloc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698