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

Unified Diff: src/IceRegAlloc.h

Issue 656023002: Subzero: Register allocator performance improvements and simplifications. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: 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
« src/IceOperand.h ('K') | « src/IceOperand.h ('k') | 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 f181a27b396824d3bffcb2f0c33031f8d8ca6a01..0742cc1d8d8d761cffe3b7ce76e68149d280e935 100644
--- a/src/IceRegAlloc.h
+++ b/src/IceRegAlloc.h
@@ -7,10 +7,9 @@
//
//===----------------------------------------------------------------------===//
//
-// This file declares the data structures used during linear-scan
-// register allocation. This includes LiveRangeWrapper which
-// encapsulates a variable and its live range, and LinearScan which
-// holds the various work queues for the linear-scan algorithm.
+// This file declares the LinearScan data structure used during
+// linear-scan register allocation, which holds the various work
+// queues for the linear-scan algorithm.
//
//===----------------------------------------------------------------------===//
@@ -22,34 +21,10 @@
namespace Ice {
-// Currently this just wraps a Variable pointer, so in principle we
-// could use containers of Variable* instead of LiveRangeWrapper. But
-// in the future, we may want to do more complex things such as live
-// range splitting, and keeping a wrapper should make that simpler.
-class LiveRangeWrapper {
-public:
- LiveRangeWrapper(Variable *Var) : Var(Var) {}
- const LiveRange &range() const { return Var->getLiveRange(); }
- bool endsBefore(const LiveRangeWrapper &Other) const {
- return range().endsBefore(Other.range());
- }
- bool overlaps(const LiveRangeWrapper &Other) const {
- const bool UseTrimmed = true;
- return range().overlaps(Other.range(), UseTrimmed);
- }
- bool overlapsStart(const LiveRangeWrapper &Other) const {
- const bool UseTrimmed = true;
- return range().overlapsInst(Other.range().getStart(), UseTrimmed);
- }
- Variable *Var;
- void dump(const Cfg *Func) const;
-
-private:
- // LiveRangeWrapper(const LiveRangeWrapper &) = delete;
- // LiveRangeWrapper &operator=(const LiveRangeWrapper &) = delete;
-};
-
class LinearScan {
+ LinearScan(const LinearScan &) = delete;
+ LinearScan &operator=(const LinearScan &) = delete;
+
public:
LinearScan(Cfg *Func) : Func(Func) {}
void scan(const llvm::SmallBitVector &RegMask);
@@ -57,15 +32,13 @@ public:
private:
Cfg *const Func;
- typedef std::vector<LiveRangeWrapper> OrderedRanges;
- typedef std::list<LiveRangeWrapper> UnorderedRanges;
+ typedef std::vector<Variable *> OrderedRanges;
+ typedef std::list<Variable *> UnorderedRanges;
OrderedRanges Unhandled;
// UnhandledPrecolored is a subset of Unhandled, specially collected
// for faster processing.
OrderedRanges UnhandledPrecolored;
UnorderedRanges Active, Inactive, Handled;
- LinearScan(const LinearScan &) = delete;
- LinearScan &operator=(const LinearScan &) = delete;
};
} // end of namespace Ice
« src/IceOperand.h ('K') | « src/IceOperand.h ('k') | src/IceRegAlloc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698