| OLD | NEW |
| 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 // This file implements the LinearScan class, which performs the | 10 // This file implements the LinearScan class, which performs the |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 // preference when the current Variable has an unambiguous "first" | 403 // preference when the current Variable has an unambiguous "first" |
| 404 // definition. The preference is some source Variable of the | 404 // definition. The preference is some source Variable of the |
| 405 // defining instruction that either is assigned a register that is | 405 // defining instruction that either is assigned a register that is |
| 406 // currently free, or that is assigned a register that is not free | 406 // currently free, or that is assigned a register that is not free |
| 407 // but overlap is allowed. Overlap is allowed when the Variable | 407 // but overlap is allowed. Overlap is allowed when the Variable |
| 408 // under consideration is single-definition, and its definition is | 408 // under consideration is single-definition, and its definition is |
| 409 // a simple assignment - i.e., the register gets copied/aliased | 409 // a simple assignment - i.e., the register gets copied/aliased |
| 410 // but is never modified. Furthermore, overlap is only allowed | 410 // but is never modified. Furthermore, overlap is only allowed |
| 411 // when preferred Variable definition instructions do not appear | 411 // when preferred Variable definition instructions do not appear |
| 412 // within the current Variable's live range. | 412 // within the current Variable's live range. |
| 413 Variable *Prefer = NULL; | 413 Variable *Prefer = nullptr; |
| 414 int32_t PreferReg = Variable::NoRegister; | 414 int32_t PreferReg = Variable::NoRegister; |
| 415 bool AllowOverlap = false; | 415 bool AllowOverlap = false; |
| 416 if (FindPreference) { | 416 if (FindPreference) { |
| 417 if (const Inst *DefInst = VMetadata->getFirstDefinition(Cur)) { | 417 if (const Inst *DefInst = VMetadata->getFirstDefinition(Cur)) { |
| 418 assert(DefInst->getDest() == Cur); | 418 assert(DefInst->getDest() == Cur); |
| 419 bool IsAssign = DefInst->isSimpleAssign(); | 419 bool IsAssign = DefInst->isSimpleAssign(); |
| 420 bool IsSingleDef = !VMetadata->isMultiDef(Cur); | 420 bool IsSingleDef = !VMetadata->isMultiDef(Cur); |
| 421 for (SizeT i = 0; i < DefInst->getSrcSize(); ++i) { | 421 for (SizeT i = 0; i < DefInst->getSrcSize(); ++i) { |
| 422 // TODO(stichnot): Iterate through the actual Variables of the | 422 // TODO(stichnot): Iterate through the actual Variables of the |
| 423 // instruction, not just the source operands. This could | 423 // instruction, not just the source operands. This could |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 Str << "\n"; | 743 Str << "\n"; |
| 744 } | 744 } |
| 745 Str << "++++++ Inactive:\n"; | 745 Str << "++++++ Inactive:\n"; |
| 746 for (const Variable *Item : Inactive) { | 746 for (const Variable *Item : Inactive) { |
| 747 dumpLiveRange(Item, Func); | 747 dumpLiveRange(Item, Func); |
| 748 Str << "\n"; | 748 Str << "\n"; |
| 749 } | 749 } |
| 750 } | 750 } |
| 751 | 751 |
| 752 } // end of namespace Ice | 752 } // end of namespace Ice |
| OLD | NEW |