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

Side by Side Diff: src/IceRegAlloc.cpp

Issue 1665423002: Subzero: Cleanup Inst==>Instr. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 4 years, 10 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/IceInstX86BaseImpl.h ('k') | src/IceSwitchLowering.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/IceRegAlloc.cpp - Linear-scan implementation -----------===// 1 //===- subzero/src/IceRegAlloc.cpp - Linear-scan implementation -----------===//
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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 FindOverlap = false; 207 FindOverlap = false;
208 SizeT NumVars = 0; 208 SizeT NumVars = 0;
209 const VarList &Vars = Func->getVariables(); 209 const VarList &Vars = Func->getVariables();
210 210
211 // Iterate across all instructions and record the begin and end of the live 211 // Iterate across all instructions and record the begin and end of the live
212 // range for each variable that is pre-colored or infinite weight. 212 // range for each variable that is pre-colored or infinite weight.
213 CfgVector<InstNumberT> LRBegin(Vars.size(), Inst::NumberSentinel); 213 CfgVector<InstNumberT> LRBegin(Vars.size(), Inst::NumberSentinel);
214 CfgVector<InstNumberT> LREnd(Vars.size(), Inst::NumberSentinel); 214 CfgVector<InstNumberT> LREnd(Vars.size(), Inst::NumberSentinel);
215 DefUseErrorList DefsWithoutUses, UsesBeforeDefs; 215 DefUseErrorList DefsWithoutUses, UsesBeforeDefs;
216 for (CfgNode *Node : Func->getNodes()) { 216 for (CfgNode *Node : Func->getNodes()) {
217 for (Inst &Inst : Node->getInsts()) { 217 for (Inst &Instr : Node->getInsts()) {
218 if (Inst.isDeleted()) 218 if (Instr.isDeleted())
219 continue; 219 continue;
220 FOREACH_VAR_IN_INST(Var, Inst) { 220 FOREACH_VAR_IN_INST(Var, Instr) {
221 if (Var->isRematerializable()) 221 if (Var->isRematerializable())
222 continue; 222 continue;
223 if (Var->getIgnoreLiveness()) 223 if (Var->getIgnoreLiveness())
224 continue; 224 continue;
225 if (Var->hasReg() || Var->mustHaveReg()) { 225 if (Var->hasReg() || Var->mustHaveReg()) {
226 SizeT VarNum = Var->getIndex(); 226 SizeT VarNum = Var->getIndex();
227 LREnd[VarNum] = Inst.getNumber(); 227 LREnd[VarNum] = Instr.getNumber();
228 if (!Var->getIsArg() && LRBegin[VarNum] == Inst::NumberSentinel) 228 if (!Var->getIsArg() && LRBegin[VarNum] == Inst::NumberSentinel)
229 UsesBeforeDefs.push_back(VarNum); 229 UsesBeforeDefs.push_back(VarNum);
230 } 230 }
231 } 231 }
232 if (const Variable *Var = Inst.getDest()) { 232 if (const Variable *Var = Instr.getDest()) {
233 if (!Var->isRematerializable() && !Var->getIgnoreLiveness() && 233 if (!Var->isRematerializable() && !Var->getIgnoreLiveness() &&
234 (Var->hasReg() || Var->mustHaveReg())) { 234 (Var->hasReg() || Var->mustHaveReg())) {
235 if (LRBegin[Var->getIndex()] == Inst::NumberSentinel) { 235 if (LRBegin[Var->getIndex()] == Inst::NumberSentinel) {
236 LRBegin[Var->getIndex()] = Inst.getNumber(); 236 LRBegin[Var->getIndex()] = Instr.getNumber();
237 ++NumVars; 237 ++NumVars;
238 } 238 }
239 } 239 }
240 } 240 }
241 } 241 }
242 } 242 }
243 243
244 Unhandled.reserve(NumVars); 244 Unhandled.reserve(NumVars);
245 UnhandledPrecolored.reserve(NumVars); 245 UnhandledPrecolored.reserve(NumVars);
246 for (SizeT i = 0; i < Vars.size(); ++i) { 246 for (SizeT i = 0; i < Vars.size(); ++i) {
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
1028 Str << "\n"; 1028 Str << "\n";
1029 } 1029 }
1030 Str << "++++++ Inactive:\n"; 1030 Str << "++++++ Inactive:\n";
1031 for (const Variable *Item : Inactive) { 1031 for (const Variable *Item : Inactive) {
1032 dumpLiveRange(Item, Func); 1032 dumpLiveRange(Item, Func);
1033 Str << "\n"; 1033 Str << "\n";
1034 } 1034 }
1035 } 1035 }
1036 1036
1037 } // end of namespace Ice 1037 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceInstX86BaseImpl.h ('k') | src/IceSwitchLowering.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698