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

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: Remove the variable definitions trimming to simplify 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
« no previous file with comments | « src/IceOperand.cpp ('k') | src/IceRegAlloc.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 const bool UseTrimmed = true;
42 return range().overlapsInst(Other.range().getStart(), UseTrimmed);
41 } 43 }
42 Variable *const Var; 44 Variable *const Var;
43 void dump(const Cfg *Func) const; 45 void dump(const Cfg *Func) const;
44 46
45 private: 47 private:
46 // LiveRangeWrapper(const LiveRangeWrapper &) = delete; 48 // LiveRangeWrapper(const LiveRangeWrapper &) = delete;
47 LiveRangeWrapper &operator=(const LiveRangeWrapper &) = delete; 49 LiveRangeWrapper &operator=(const LiveRangeWrapper &) = delete;
48 }; 50 };
49 51
50 class LinearScan { 52 class LinearScan {
(...skipping 24 matching lines...) Expand all
75 // for faster processing. 77 // for faster processing.
76 OrderedRanges UnhandledPrecolored; 78 OrderedRanges UnhandledPrecolored;
77 UnorderedRanges Active, Inactive, Handled; 79 UnorderedRanges Active, Inactive, Handled;
78 LinearScan(const LinearScan &) = delete; 80 LinearScan(const LinearScan &) = delete;
79 LinearScan &operator=(const LinearScan &) = delete; 81 LinearScan &operator=(const LinearScan &) = delete;
80 }; 82 };
81 83
82 } // end of namespace Ice 84 } // end of namespace Ice
83 85
84 #endif // SUBZERO_SRC_ICEREGALLOC_H 86 #endif // SUBZERO_SRC_ICEREGALLOC_H
OLDNEW
« no previous file with comments | « src/IceOperand.cpp ('k') | src/IceRegAlloc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698