| OLD | NEW |
| 1 //===- subzero/src/IceOperand.cpp - High-level operand implementation -----===// | 1 //===- subzero/src/IceOperand.cpp - High-level operand 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 // This file implements the Operand class and its target-independent | 10 // This file implements the Operand class and its target-independent |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 case MDS_MultiDefSingleBlock: | 268 case MDS_MultiDefSingleBlock: |
| 269 return NULL; | 269 return NULL; |
| 270 case MDS_SingleDef: | 270 case MDS_SingleDef: |
| 271 assert(!Definitions.empty()); | 271 assert(!Definitions.empty()); |
| 272 return Definitions[0]; | 272 return Definitions[0]; |
| 273 } | 273 } |
| 274 } | 274 } |
| 275 | 275 |
| 276 void VariablesMetadata::init() { | 276 void VariablesMetadata::init() { |
| 277 static TimerIdT IDvmetadata = GlobalContext::getTimerID("vmetadata"); | 277 static TimerIdT IDvmetadata = GlobalContext::getTimerID("vmetadata"); |
| 278 TimerMarker T(IDvmetadata, Func->getContext()); | 278 TimerMarker T(IDvmetadata, Func); |
| 279 Metadata.clear(); | 279 Metadata.clear(); |
| 280 Metadata.resize(Func->getNumVariables()); | 280 Metadata.resize(Func->getNumVariables()); |
| 281 | 281 |
| 282 // Mark implicit args as being used in the entry node. | 282 // Mark implicit args as being used in the entry node. |
| 283 for (Variable *Var : Func->getImplicitArgs()) { | 283 for (Variable *Var : Func->getImplicitArgs()) { |
| 284 const Inst *NoInst = NULL; | 284 const Inst *NoInst = NULL; |
| 285 const CfgNode *EntryNode = Func->getEntryNode(); | 285 const CfgNode *EntryNode = Func->getEntryNode(); |
| 286 const bool IsFromDef = false; | 286 const bool IsFromDef = false; |
| 287 const bool IsImplicit = true; | 287 const bool IsImplicit = true; |
| 288 Metadata[Var->getIndex()].markUse(NoInst, EntryNode, IsFromDef, IsImplicit); | 288 Metadata[Var->getIndex()].markUse(NoInst, EntryNode, IsFromDef, IsImplicit); |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 void ConstantRelocatable::dump(const Cfg *, Ostream &Str) const { | 427 void ConstantRelocatable::dump(const Cfg *, Ostream &Str) const { |
| 428 Str << "@" << Name; | 428 Str << "@" << Name; |
| 429 if (Offset) | 429 if (Offset) |
| 430 Str << "+" << Offset; | 430 Str << "+" << Offset; |
| 431 } | 431 } |
| 432 | 432 |
| 433 void LiveRange::dump(Ostream &Str) const { | 433 void LiveRange::dump(Ostream &Str) const { |
| 434 Str << "(weight=" << Weight << ") "; | 434 Str << "(weight=" << Weight << ") "; |
| 435 bool First = true; | 435 bool First = true; |
| 436 for (const RangeElementType &I : Range) { | 436 for (const RangeElementType &I : Range) { |
| 437 if (First) | 437 if (!First) |
| 438 Str << ", "; | 438 Str << ", "; |
| 439 First = false; | 439 First = false; |
| 440 Str << "[" << I.first << ":" << I.second << ")"; | 440 Str << "[" << I.first << ":" << I.second << ")"; |
| 441 } | 441 } |
| 442 } | 442 } |
| 443 | 443 |
| 444 Ostream &operator<<(Ostream &Str, const LiveRange &L) { | 444 Ostream &operator<<(Ostream &Str, const LiveRange &L) { |
| 445 L.dump(Str); | 445 L.dump(Str); |
| 446 return Str; | 446 return Str; |
| 447 } | 447 } |
| 448 | 448 |
| 449 Ostream &operator<<(Ostream &Str, const RegWeight &W) { | 449 Ostream &operator<<(Ostream &Str, const RegWeight &W) { |
| 450 if (W.getWeight() == RegWeight::Inf) | 450 if (W.getWeight() == RegWeight::Inf) |
| 451 Str << "Inf"; | 451 Str << "Inf"; |
| 452 else | 452 else |
| 453 Str << W.getWeight(); | 453 Str << W.getWeight(); |
| 454 return Str; | 454 return Str; |
| 455 } | 455 } |
| 456 | 456 |
| 457 } // end of namespace Ice | 457 } // end of namespace Ice |
| OLD | NEW |