| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 // bit. | 159 // bit. |
| 160 void LinearScan::initForInfOnly() { | 160 void LinearScan::initForInfOnly() { |
| 161 TimerMarker T(TimerStack::TT_initUnhandled, Func); | 161 TimerMarker T(TimerStack::TT_initUnhandled, Func); |
| 162 FindPreference = false; | 162 FindPreference = false; |
| 163 FindOverlap = false; | 163 FindOverlap = false; |
| 164 SizeT NumVars = 0; | 164 SizeT NumVars = 0; |
| 165 const VarList &Vars = Func->getVariables(); | 165 const VarList &Vars = Func->getVariables(); |
| 166 | 166 |
| 167 // Iterate across all instructions and record the begin and end of the live | 167 // Iterate across all instructions and record the begin and end of the live |
| 168 // range for each variable that is pre-colored or infinite weight. | 168 // range for each variable that is pre-colored or infinite weight. |
| 169 std::vector<InstNumberT> LRBegin(Vars.size(), Inst::NumberSentinel); | 169 CfgVector<InstNumberT> LRBegin(Vars.size(), Inst::NumberSentinel); |
| 170 std::vector<InstNumberT> LREnd(Vars.size(), Inst::NumberSentinel); | 170 CfgVector<InstNumberT> LREnd(Vars.size(), Inst::NumberSentinel); |
| 171 for (CfgNode *Node : Func->getNodes()) { | 171 for (CfgNode *Node : Func->getNodes()) { |
| 172 for (Inst &Inst : Node->getInsts()) { | 172 for (Inst &Inst : Node->getInsts()) { |
| 173 if (Inst.isDeleted()) | 173 if (Inst.isDeleted()) |
| 174 continue; | 174 continue; |
| 175 if (const Variable *Var = Inst.getDest()) { | 175 if (const Variable *Var = Inst.getDest()) { |
| 176 if (!Var->getIgnoreLiveness() && | 176 if (!Var->getIgnoreLiveness() && |
| 177 (Var->hasReg() || Var->mustHaveReg())) { | 177 (Var->hasReg() || Var->mustHaveReg())) { |
| 178 if (LRBegin[Var->getIndex()] == Inst::NumberSentinel) { | 178 if (LRBegin[Var->getIndex()] == Inst::NumberSentinel) { |
| 179 LRBegin[Var->getIndex()] = Inst.getNumber(); | 179 LRBegin[Var->getIndex()] = Inst.getNumber(); |
| 180 ++NumVars; | 180 ++NumVars; |
| (...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 883 Str << "\n"; | 883 Str << "\n"; |
| 884 } | 884 } |
| 885 Str << "++++++ Inactive:\n"; | 885 Str << "++++++ Inactive:\n"; |
| 886 for (const Variable *Item : Inactive) { | 886 for (const Variable *Item : Inactive) { |
| 887 dumpLiveRange(Item, Func); | 887 dumpLiveRange(Item, Func); |
| 888 Str << "\n"; | 888 Str << "\n"; |
| 889 } | 889 } |
| 890 } | 890 } |
| 891 | 891 |
| 892 } // end of namespace Ice | 892 } // end of namespace Ice |
| OLD | NEW |