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 /// \file | 10 /// \file |
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 for (SizeT i = MinWeightIndex + 1; i < Iter.Weights.size(); ++i) { | 678 for (SizeT i = MinWeightIndex + 1; i < Iter.Weights.size(); ++i) { |
679 if (Iter.RegMask[i] && Iter.Weights[i] < Iter.Weights[MinWeightIndex]) | 679 if (Iter.RegMask[i] && Iter.Weights[i] < Iter.Weights[MinWeightIndex]) |
680 MinWeightIndex = i; | 680 MinWeightIndex = i; |
681 } | 681 } |
682 | 682 |
683 if (Iter.Cur->getWeight(Func) <= Iter.Weights[MinWeightIndex]) { | 683 if (Iter.Cur->getWeight(Func) <= Iter.Weights[MinWeightIndex]) { |
684 // Cur doesn't have priority over any other live ranges, so don't allocate | 684 // Cur doesn't have priority over any other live ranges, so don't allocate |
685 // any register to it, and move it to the Handled state. | 685 // any register to it, and move it to the Handled state. |
686 Handled.push_back(Iter.Cur); | 686 Handled.push_back(Iter.Cur); |
687 if (Iter.Cur->mustHaveReg()) { | 687 if (Iter.Cur->mustHaveReg()) { |
688 if (Kind == RAK_Phi) | 688 if (Kind == RAK_Phi) { |
689 addSpillFill(Iter); | 689 addSpillFill(Iter); |
690 else | 690 } else { |
| 691 dumpLiveRangeTrace("Failing ", Iter.Cur); |
691 Func->setError("Unable to find a physical register for an " | 692 Func->setError("Unable to find a physical register for an " |
692 "infinite-weight live range"); | 693 "infinite-weight live range: " + |
| 694 Iter.Cur->getName(Func)); |
| 695 } |
693 } | 696 } |
694 } else { | 697 } else { |
695 // Evict all live ranges in Active that register number MinWeightIndex is | 698 // Evict all live ranges in Active that register number MinWeightIndex is |
696 // assigned to. | 699 // assigned to. |
697 const llvm::SmallBitVector &Aliases = *RegAliases[MinWeightIndex]; | 700 const llvm::SmallBitVector &Aliases = *RegAliases[MinWeightIndex]; |
698 for (SizeT I = Active.size(); I > 0; --I) { | 701 for (SizeT I = Active.size(); I > 0; --I) { |
699 const SizeT Index = I - 1; | 702 const SizeT Index = I - 1; |
700 Variable *Item = Active[Index]; | 703 Variable *Item = Active[Index]; |
701 int32_t RegNum = Item->getRegNumTmp(); | 704 int32_t RegNum = Item->getRegNumTmp(); |
702 if (Aliases[RegNum]) { | 705 if (Aliases[RegNum]) { |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
978 Str << "\n"; | 981 Str << "\n"; |
979 } | 982 } |
980 Str << "++++++ Inactive:\n"; | 983 Str << "++++++ Inactive:\n"; |
981 for (const Variable *Item : Inactive) { | 984 for (const Variable *Item : Inactive) { |
982 dumpLiveRange(Item, Func); | 985 dumpLiveRange(Item, Func); |
983 Str << "\n"; | 986 Str << "\n"; |
984 } | 987 } |
985 } | 988 } |
986 | 989 |
987 } // end of namespace Ice | 990 } // end of namespace Ice |
OLD | NEW |