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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 } | 88 } |
89 assert(MinWeightIndex >= 0); | 89 assert(MinWeightIndex >= 0); |
90 return MinWeightIndex; | 90 return MinWeightIndex; |
91 } | 91 } |
92 | 92 |
93 } // end of anonymous namespace | 93 } // end of anonymous namespace |
94 | 94 |
95 LinearScan::LinearScan(Cfg *Func) | 95 LinearScan::LinearScan(Cfg *Func) |
96 : Func(Func), Ctx(Func->getContext()), Target(Func->getTarget()), | 96 : Func(Func), Ctx(Func->getContext()), Target(Func->getTarget()), |
97 Verbose(BuildDefs::dump() && Func->isVerbose(IceV_LinearScan)), | 97 Verbose(BuildDefs::dump() && Func->isVerbose(IceV_LinearScan)), |
98 UseReserve(Ctx->getFlags().getRegAllocReserve()) {} | 98 UseReserve(getFlags().getRegAllocReserve()) {} |
99 | 99 |
100 // Prepare for full register allocation of all variables. We depend on liveness | 100 // Prepare for full register allocation of all variables. We depend on liveness |
101 // analysis to have calculated live ranges. | 101 // analysis to have calculated live ranges. |
102 void LinearScan::initForGlobal() { | 102 void LinearScan::initForGlobal() { |
103 TimerMarker T(TimerStack::TT_initUnhandled, Func); | 103 TimerMarker T(TimerStack::TT_initUnhandled, Func); |
104 FindPreference = true; | 104 FindPreference = true; |
105 // For full register allocation, normally we want to enable FindOverlap | 105 // For full register allocation, normally we want to enable FindOverlap |
106 // (meaning we look for opportunities for two overlapping live ranges to | 106 // (meaning we look for opportunities for two overlapping live ranges to |
107 // safely share the same register). However, we disable it for phi-lowering | 107 // safely share the same register). However, we disable it for phi-lowering |
108 // register allocation since no overlap opportunities should be available and | 108 // register allocation since no overlap opportunities should be available and |
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1009 Str << "\n"; | 1009 Str << "\n"; |
1010 } | 1010 } |
1011 Str << "++++++ Inactive:\n"; | 1011 Str << "++++++ Inactive:\n"; |
1012 for (const Variable *Item : Inactive) { | 1012 for (const Variable *Item : Inactive) { |
1013 dumpLiveRange(Item, Func); | 1013 dumpLiveRange(Item, Func); |
1014 Str << "\n"; | 1014 Str << "\n"; |
1015 } | 1015 } |
1016 } | 1016 } |
1017 | 1017 |
1018 } // end of namespace Ice | 1018 } // end of namespace Ice |
OLD | NEW |