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

Side by Side Diff: src/IceInst.h

Issue 2177033002: Subzero: Local variable splitting. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes, mostly renaming. 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/IceClFlags.def ('k') | src/IceInst.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/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);
115 // Invalidates liveness info because the use Srcs[Index] is removed.
116 Srcs[Index] = Replacement; 114 Srcs[Index] = Replacement;
117 } 115 }
118 116
119 bool isLastUse(const Operand *Src) const; 117 bool isLastUse(const Operand *Src) const;
120 void spliceLivenessInfo(Inst *OrigInst, Inst *SpliceAssn); 118 void spliceLivenessInfo(Inst *OrigInst, Inst *SpliceAssn);
121 119
122 /// Returns a list of out-edges corresponding to a terminator instruction, 120 /// 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 121 /// which is the last instruction of the block. The list must not contain
124 /// duplicates. 122 /// duplicates.
125 virtual NodeList getTerminatorEdges() const { 123 virtual NodeList getTerminatorEdges() const {
(...skipping 18 matching lines...) Expand all
144 /// "var_dest=var_src" assignment where the dest and src are both variables. 142 /// "var_dest=var_src" assignment where the dest and src are both variables.
145 virtual bool isVarAssign() const { return false; } 143 virtual bool isVarAssign() const { return false; }
146 144
147 /// Returns true if the instruction has a possible side effect of changing 145 /// Returns true if the instruction has a possible side effect of changing
148 /// memory, in which case a memory load should not be reordered with respect 146 /// memory, in which case a memory load should not be reordered with respect
149 /// to this instruction. It should really be pure virtual, but we can't 147 /// to this instruction. It should really be pure virtual, but we can't
150 /// because of g++ and llvm::ilist<>, so we implement it as 148 /// because of g++ and llvm::ilist<>, so we implement it as
151 /// report_fatal_error(). 149 /// report_fatal_error().
152 virtual bool isMemoryWrite() const; 150 virtual bool isMemoryWrite() const;
153 151
152 /// Returns true if the (target-specific) instruction represents an
153 /// intra-block label, i.e. branch target. This is meant primarily for
154 /// Cfg::splitLocalVars().
155 virtual bool isLabel() const { return false; }
156 /// If the (target-specific) instruction represents an intra-block branch to
157 /// some Label instruction, return that Label branch target instruction;
158 /// otherwise return nullptr.
159 virtual const Inst *getIntraBlockBranchTarget() const { return nullptr; }
160
154 void livenessLightweight(Cfg *Func, LivenessBV &Live); 161 void livenessLightweight(Cfg *Func, LivenessBV &Live);
155 /// Calculates liveness for this instruction. Returns true if this instruction 162 /// Calculates liveness for this instruction. Returns true if this instruction
156 /// is (tentatively) still live and should be retained, and false if this 163 /// is (tentatively) still live and should be retained, and false if this
157 /// instruction is (tentatively) dead and should be deleted. The decision is 164 /// instruction is (tentatively) dead and should be deleted. The decision is
158 /// tentative until the liveness dataflow algorithm has converged, and then a 165 /// tentative until the liveness dataflow algorithm has converged, and then a
159 /// separate pass permanently deletes dead instructions. 166 /// separate pass permanently deletes dead instructions.
160 bool liveness(InstNumberT InstNumber, LivenessBV &Live, Liveness *Liveness, 167 bool liveness(InstNumberT InstNumber, LivenessBV &Live, Liveness *Liveness,
161 LiveBeginEndMap *LiveBegin, LiveBeginEndMap *LiveEnd); 168 LiveBeginEndMap *LiveBegin, LiveBeginEndMap *LiveEnd);
162 169
163 /// Get the number of native instructions that this instruction ultimately 170 /// Get the number of native instructions that this instruction ultimately
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after
1147 1154
1148 inline Inst *iteratorToInst(InstList::iterator Iter) { return &*Iter; } 1155 inline Inst *iteratorToInst(InstList::iterator Iter) { return &*Iter; }
1149 1156
1150 inline const Inst *iteratorToInst(InstList::const_iterator Iter) { 1157 inline const Inst *iteratorToInst(InstList::const_iterator Iter) {
1151 return &*Iter; 1158 return &*Iter;
1152 } 1159 }
1153 1160
1154 } // end of namespace Ice 1161 } // end of namespace Ice
1155 1162
1156 #endif // SUBZERO_SRC_ICEINST_H 1163 #endif // SUBZERO_SRC_ICEINST_H
OLDNEW
« no previous file with comments | « src/IceClFlags.def ('k') | src/IceInst.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698