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

Side by Side Diff: src/IceRegAlloc.h

Issue 1253833002: Subzero: Cleanly implement register allocation after phi lowering. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Improve translation-time performance Created 5 years, 4 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 /// \file 10 /// \file
(...skipping 21 matching lines...) Expand all
32 void init(RegAllocKind Kind); 32 void init(RegAllocKind Kind);
33 void scan(const llvm::SmallBitVector &RegMask, bool Randomized); 33 void scan(const llvm::SmallBitVector &RegMask, bool Randomized);
34 void dump(Cfg *Func) const; 34 void dump(Cfg *Func) const;
35 35
36 private: 36 private:
37 typedef std::vector<Variable *> OrderedRanges; 37 typedef std::vector<Variable *> OrderedRanges;
38 typedef std::vector<Variable *> UnorderedRanges; 38 typedef std::vector<Variable *> UnorderedRanges;
39 39
40 void initForGlobal(); 40 void initForGlobal();
41 void initForInfOnly(); 41 void initForInfOnly();
42 /// Free up a register for infinite-weight Cur by spilling and reloading some
43 /// register that isn't used during Cur's live range.
44 void addSpillFill(Variable *Cur, llvm::SmallBitVector RegMask);
42 /// Move an item from the From set to the To set. From[Index] is 45 /// Move an item from the From set to the To set. From[Index] is
43 /// pushed onto the end of To[], then the item is efficiently removed 46 /// pushed onto the end of To[], then the item is efficiently removed
44 /// from From[] by effectively swapping it with the last item in 47 /// from From[] by effectively swapping it with the last item in
45 /// From[] and then popping it from the back. As such, the caller is 48 /// From[] and then popping it from the back. As such, the caller is
46 /// best off iterating over From[] in reverse order to avoid the need 49 /// best off iterating over From[] in reverse order to avoid the need
47 /// for special handling of the iterator. 50 /// for special handling of the iterator.
48 void moveItem(UnorderedRanges &From, SizeT Index, UnorderedRanges &To) { 51 void moveItem(UnorderedRanges &From, SizeT Index, UnorderedRanges &To) {
49 To.push_back(From[Index]); 52 To.push_back(From[Index]);
50 From[Index] = From.back(); 53 From[Index] = From.back();
51 From.pop_back(); 54 From.pop_back();
52 } 55 }
53 56
54 Cfg *const Func; 57 Cfg *const Func;
55 OrderedRanges Unhandled; 58 OrderedRanges Unhandled;
56 /// UnhandledPrecolored is a subset of Unhandled, specially collected 59 /// UnhandledPrecolored is a subset of Unhandled, specially collected
57 /// for faster processing. 60 /// for faster processing.
58 OrderedRanges UnhandledPrecolored; 61 OrderedRanges UnhandledPrecolored;
59 UnorderedRanges Active, Inactive, Handled; 62 UnorderedRanges Active, Inactive, Handled;
60 std::vector<InstNumberT> Kills; 63 std::vector<InstNumberT> Kills;
64 RegAllocKind Kind = RAK_Unknown;
61 bool FindPreference = false; 65 bool FindPreference = false;
62 bool FindOverlap = false; 66 bool FindOverlap = false;
63 // TODO(stichnot): We're not really using FindOverlap yet, but we
64 // may want a flavor of register allocation where FindPreference is
65 // useful but we didn't want to initialize VMetadata with VMK_All
66 // and therefore we can't safely allow overlap.
67 }; 67 };
68 68
69 } // end of namespace Ice 69 } // end of namespace Ice
70 70
71 #endif // SUBZERO_SRC_ICEREGALLOC_H 71 #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