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