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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 98 |
99 // Gather the live ranges of all variables and add them to the | 99 // Gather the live ranges of all variables and add them to the |
100 // Unhandled set. | 100 // Unhandled set. |
101 const VarList &Vars = Func->getVariables(); | 101 const VarList &Vars = Func->getVariables(); |
102 { | 102 { |
103 TimerMarker T(TimerStack::TT_initUnhandled, Func); | 103 TimerMarker T(TimerStack::TT_initUnhandled, Func); |
104 Unhandled.reserve(Vars.size()); | 104 Unhandled.reserve(Vars.size()); |
105 for (Variable *Var : Vars) { | 105 for (Variable *Var : Vars) { |
106 // Explicitly don't consider zero-weight variables, which are | 106 // Explicitly don't consider zero-weight variables, which are |
107 // meant to be spill slots. | 107 // meant to be spill slots. |
108 if (Var->getWeight() == RegWeight::Zero) | 108 if (Var->getWeight() == RegWeight::Zero) { |
| 109 Var->setNeedsStackSlot(); |
109 continue; | 110 continue; |
| 111 } |
110 // Don't bother if the variable has a null live range, which means | 112 // Don't bother if the variable has a null live range, which means |
111 // it was never referenced. | 113 // it was never referenced. |
112 if (Var->getLiveRange().isEmpty()) | 114 if (Var->getLiveRange().isEmpty()) |
113 continue; | 115 continue; |
| 116 Var->setNeedsStackSlot(); |
114 Var->untrimLiveRange(); | 117 Var->untrimLiveRange(); |
115 Unhandled.push_back(Var); | 118 Unhandled.push_back(Var); |
116 if (Var->hasReg()) { | 119 if (Var->hasReg()) { |
117 Var->setRegNumTmp(Var->getRegNum()); | 120 Var->setRegNumTmp(Var->getRegNum()); |
118 Var->setLiveRangeInfiniteWeight(); | 121 Var->setLiveRangeInfiniteWeight(); |
119 UnhandledPrecolored.push_back(Var); | 122 UnhandledPrecolored.push_back(Var); |
120 } | 123 } |
121 } | 124 } |
122 struct CompareRanges { | 125 struct CompareRanges { |
123 bool operator()(const Variable *L, const Variable *R) { | 126 bool operator()(const Variable *L, const Variable *R) { |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 Str << "\n"; | 575 Str << "\n"; |
573 } | 576 } |
574 Str << "++++++ Inactive:\n"; | 577 Str << "++++++ Inactive:\n"; |
575 for (const Variable *Item : Inactive) { | 578 for (const Variable *Item : Inactive) { |
576 dumpLiveRange(Item, Func); | 579 dumpLiveRange(Item, Func); |
577 Str << "\n"; | 580 Str << "\n"; |
578 } | 581 } |
579 } | 582 } |
580 | 583 |
581 } // end of namespace Ice | 584 } // end of namespace Ice |
OLD | NEW |