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

Side by Side Diff: src/IceRegAlloc.h

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 unified diff | Download patch
OLDNEW
1 //===- subzero/src/IceRegAlloc.h - Linear-scan reg. allocation --*- C++ -*-===// 1 //===- subzero/src/IceRegAlloc.h - Linear-scan reg. allocation --*- C++ -*-===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This file declares the data structures used during linear-scan 10 // This file declares the data structures used during linear-scan
(...skipping 16 matching lines...) Expand all
27 // in the future, we may want to do more complex things such as live 27 // in the future, we may want to do more complex things such as live
28 // range splitting, and keeping a wrapper should make that simpler. 28 // range splitting, and keeping a wrapper should make that simpler.
29 class LiveRangeWrapper { 29 class LiveRangeWrapper {
30 public: 30 public:
31 LiveRangeWrapper(Variable *Var) : Var(Var) {} 31 LiveRangeWrapper(Variable *Var) : Var(Var) {}
32 const LiveRange &range() const { return Var->getLiveRange(); } 32 const LiveRange &range() const { return Var->getLiveRange(); }
33 bool endsBefore(const LiveRangeWrapper &Other) const { 33 bool endsBefore(const LiveRangeWrapper &Other) const {
34 return range().endsBefore(Other.range()); 34 return range().endsBefore(Other.range());
35 } 35 }
36 bool overlaps(const LiveRangeWrapper &Other) const { 36 bool overlaps(const LiveRangeWrapper &Other) const {
37 return range().overlaps(Other.range()); 37 const bool UseTrimmed = true;
38 return range().overlaps(Other.range(), UseTrimmed);
38 } 39 }
39 bool overlapsStart(const LiveRangeWrapper &Other) const { 40 bool overlapsStart(const LiveRangeWrapper &Other) const {
40 return range().overlaps(Other.range().getStart()); 41 return range().overlaps(Other.range().getStart());
41 } 42 }
42 Variable *const Var; 43 Variable *const Var;
43 void dump(const Cfg *Func) const; 44 void dump(const Cfg *Func) const;
44 45
45 private: 46 private:
46 // LiveRangeWrapper(const LiveRangeWrapper &) = delete; 47 // LiveRangeWrapper(const LiveRangeWrapper &) = delete;
47 LiveRangeWrapper &operator=(const LiveRangeWrapper &) = delete; 48 LiveRangeWrapper &operator=(const LiveRangeWrapper &) = delete;
(...skipping 27 matching lines...) Expand all
75 // for faster processing. 76 // for faster processing.
76 OrderedRanges UnhandledPrecolored; 77 OrderedRanges UnhandledPrecolored;
77 UnorderedRanges Active, Inactive, Handled; 78 UnorderedRanges Active, Inactive, Handled;
78 LinearScan(const LinearScan &) = delete; 79 LinearScan(const LinearScan &) = delete;
79 LinearScan &operator=(const LinearScan &) = delete; 80 LinearScan &operator=(const LinearScan &) = delete;
80 }; 81 };
81 82
82 } // end of namespace Ice 83 } // end of namespace Ice
83 84
84 #endif // SUBZERO_SRC_ICEREGALLOC_H 85 #endif // SUBZERO_SRC_ICEREGALLOC_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698