OLD | NEW |
1 //===- subzero/src/IceInst.cpp - High-level instruction implementation ----===// | 1 //===- subzero/src/IceInst.cpp - High-level instruction 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 Inst class, primarily the various | 10 // This file implements the Inst class, primarily the various |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 return IceType_void; | 457 return IceType_void; |
458 return Dest->getType(); | 458 return Dest->getType(); |
459 } | 459 } |
460 | 460 |
461 // ======================== Dump routines ======================== // | 461 // ======================== Dump routines ======================== // |
462 | 462 |
463 void Inst::dumpDecorated(const Cfg *Func) const { | 463 void Inst::dumpDecorated(const Cfg *Func) const { |
464 if (!ALLOW_DUMP) | 464 if (!ALLOW_DUMP) |
465 return; | 465 return; |
466 Ostream &Str = Func->getContext()->getStrDump(); | 466 Ostream &Str = Func->getContext()->getStrDump(); |
467 if (!Func->getContext()->isVerbose(IceV_Deleted) && | 467 if (!Func->isVerbose(IceV_Deleted) && (isDeleted() || isRedundantAssign())) |
468 (isDeleted() || isRedundantAssign())) | |
469 return; | 468 return; |
470 if (Func->getContext()->isVerbose(IceV_InstNumbers)) { | 469 if (Func->isVerbose(IceV_InstNumbers)) { |
471 char buf[30]; | 470 char buf[30]; |
472 InstNumberT Number = getNumber(); | 471 InstNumberT Number = getNumber(); |
473 if (Number == NumberDeleted) | 472 if (Number == NumberDeleted) |
474 snprintf(buf, llvm::array_lengthof(buf), "[XXX]"); | 473 snprintf(buf, llvm::array_lengthof(buf), "[XXX]"); |
475 else | 474 else |
476 snprintf(buf, llvm::array_lengthof(buf), "[%3d]", Number); | 475 snprintf(buf, llvm::array_lengthof(buf), "[%3d]", Number); |
477 Str << buf; | 476 Str << buf; |
478 } | 477 } |
479 Str << " "; | 478 Str << " "; |
480 if (isDeleted()) | 479 if (isDeleted()) |
(...skipping 12 matching lines...) Expand all Loading... |
493 dumpSources(Func); | 492 dumpSources(Func); |
494 } | 493 } |
495 | 494 |
496 void Inst::dumpExtras(const Cfg *Func) const { | 495 void Inst::dumpExtras(const Cfg *Func) const { |
497 if (!ALLOW_DUMP) | 496 if (!ALLOW_DUMP) |
498 return; | 497 return; |
499 Ostream &Str = Func->getContext()->getStrDump(); | 498 Ostream &Str = Func->getContext()->getStrDump(); |
500 bool First = true; | 499 bool First = true; |
501 // Print "LIVEEND={a,b,c}" for all source operands whose live ranges | 500 // Print "LIVEEND={a,b,c}" for all source operands whose live ranges |
502 // are known to end at this instruction. | 501 // are known to end at this instruction. |
503 if (Func->getContext()->isVerbose(IceV_Liveness)) { | 502 if (Func->isVerbose(IceV_Liveness)) { |
504 for (SizeT I = 0; I < getSrcSize(); ++I) { | 503 for (SizeT I = 0; I < getSrcSize(); ++I) { |
505 Operand *Src = getSrc(I); | 504 Operand *Src = getSrc(I); |
506 SizeT NumVars = Src->getNumVars(); | 505 SizeT NumVars = Src->getNumVars(); |
507 for (SizeT J = 0; J < NumVars; ++J) { | 506 for (SizeT J = 0; J < NumVars; ++J) { |
508 const Variable *Var = Src->getVar(J); | 507 const Variable *Var = Src->getVar(J); |
509 if (isLastUse(Var)) { | 508 if (isLastUse(Var)) { |
510 if (First) | 509 if (First) |
511 Str << " // LIVEEND={"; | 510 Str << " // LIVEEND={"; |
512 else | 511 else |
513 Str << ","; | 512 Str << ","; |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 | 818 |
820 void InstTarget::dump(const Cfg *Func) const { | 819 void InstTarget::dump(const Cfg *Func) const { |
821 if (!ALLOW_DUMP) | 820 if (!ALLOW_DUMP) |
822 return; | 821 return; |
823 Ostream &Str = Func->getContext()->getStrDump(); | 822 Ostream &Str = Func->getContext()->getStrDump(); |
824 Str << "[TARGET] "; | 823 Str << "[TARGET] "; |
825 Inst::dump(Func); | 824 Inst::dump(Func); |
826 } | 825 } |
827 | 826 |
828 } // end of namespace Ice | 827 } // end of namespace Ice |
OLD | NEW |