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

Side by Side Diff: src/IceInst.h

Issue 2172313002: Subzero : Live Range Splitting after initial Register Allocation (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Add comment Created 4 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/IceDefs.h ('k') | src/IceOperand.h » ('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/IceInst.h - High-level instructions ----------*- C++ -*-===// 1 //===- subzero/src/IceInst.h - High-level instructions ----------*- 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 Variable *getDest() const { return Dest; } 104 Variable *getDest() const { return Dest; }
105 105
106 SizeT getSrcSize() const { return Srcs.size(); } 106 SizeT getSrcSize() const { return Srcs.size(); }
107 Operand *getSrc(SizeT I) const { 107 Operand *getSrc(SizeT I) const {
108 assert(I < getSrcSize()); 108 assert(I < getSrcSize());
109 return Srcs[I]; 109 return Srcs[I];
110 } 110 }
111 void replaceSource(SizeT Index, Operand *Replacement) { 111 void replaceSource(SizeT Index, Operand *Replacement) {
112 assert(Index < getSrcSize()); 112 assert(Index < getSrcSize());
113 assert(!isDeleted()); 113 assert(!isDeleted());
114 assert(LiveRangesEnded == 0); 114 // assert(LiveRangesEnded == 0);
115 // Invalidates liveness info because the use Srcs[Index] is removed. 115 // Invalidates liveness info because the use Srcs[Index] is removed.
116 Srcs[Index] = Replacement; 116 Srcs[Index] = Replacement;
117 } 117 }
118 118
119 bool isLastUse(const Operand *Src) const; 119 bool isLastUse(const Operand *Src) const;
120 void spliceLivenessInfo(Inst *OrigInst, Inst *SpliceAssn); 120 void spliceLivenessInfo(Inst *OrigInst, Inst *SpliceAssn);
121 121
122 /// Returns a list of out-edges corresponding to a terminator instruction, 122 /// Returns a list of out-edges corresponding to a terminator instruction,
123 /// which is the last instruction of the block. The list must not contain 123 /// which is the last instruction of the block. The list must not contain
124 /// duplicates. 124 /// duplicates.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 virtual void emitIAS(const Cfg *Func) const { emit(Func); } 177 virtual void emitIAS(const Cfg *Func) const { emit(Func); }
178 virtual void dump(const Cfg *Func) const; 178 virtual void dump(const Cfg *Func) const;
179 virtual void dumpExtras(const Cfg *Func) const; 179 virtual void dumpExtras(const Cfg *Func) const;
180 void dumpDecorated(const Cfg *Func) const; 180 void dumpDecorated(const Cfg *Func) const;
181 void emitSources(const Cfg *Func) const; 181 void emitSources(const Cfg *Func) const;
182 void dumpSources(const Cfg *Func) const; 182 void dumpSources(const Cfg *Func) const;
183 void dumpDest(const Cfg *Func) const; 183 void dumpDest(const Cfg *Func) const;
184 virtual bool isRedundantAssign() const { return false; } 184 virtual bool isRedundantAssign() const { return false; }
185 185
186 virtual ~Inst() = default; 186 virtual ~Inst() = default;
187 void replaceDest(Variable *Var) { Dest = Var; }
187 188
188 protected: 189 protected:
189 Inst(Cfg *Func, InstKind Kind, SizeT MaxSrcs, Variable *Dest); 190 Inst(Cfg *Func, InstKind Kind, SizeT MaxSrcs, Variable *Dest);
190 void addSource(Operand *Src) { 191 void addSource(Operand *Src) {
191 assert(Src); 192 assert(Src);
192 Srcs.push_back(Src); 193 Srcs.push_back(Src);
193 } 194 }
194 void setLastUse(SizeT VarIndex) { 195 void setLastUse(SizeT VarIndex) {
195 if (VarIndex < CHAR_BIT * sizeof(LiveRangesEnded)) 196 if (VarIndex < CHAR_BIT * sizeof(LiveRangesEnded))
196 LiveRangesEnded |= (((LREndedBits)1u) << VarIndex); 197 LiveRangesEnded |= (((LREndedBits)1u) << VarIndex);
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
1147 1148
1148 inline Inst *iteratorToInst(InstList::iterator Iter) { return &*Iter; } 1149 inline Inst *iteratorToInst(InstList::iterator Iter) { return &*Iter; }
1149 1150
1150 inline const Inst *iteratorToInst(InstList::const_iterator Iter) { 1151 inline const Inst *iteratorToInst(InstList::const_iterator Iter) {
1151 return &*Iter; 1152 return &*Iter;
1152 } 1153 }
1153 1154
1154 } // end of namespace Ice 1155 } // end of namespace Ice
1155 1156
1156 #endif // SUBZERO_SRC_ICEINST_H 1157 #endif // SUBZERO_SRC_ICEINST_H
OLDNEW
« no previous file with comments | « src/IceDefs.h ('k') | src/IceOperand.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698