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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
64 Str << "," << Defs[i]->getNumber(); | 64 Str << "," << Defs[i]->getNumber(); |
65 } | 65 } |
66 Str << "\n"; | 66 Str << "\n"; |
67 } | 67 } |
68 | 68 |
69 void dumpLiveRange(const Variable *Var, const Cfg *Func) { | 69 void dumpLiveRange(const Variable *Var, const Cfg *Func) { |
70 if (!BuildDefs::dump()) | 70 if (!BuildDefs::dump()) |
71 return; | 71 return; |
72 Ostream &Str = Func->getContext()->getStrDump(); | 72 Ostream &Str = Func->getContext()->getStrDump(); |
73 char buf[30]; | 73 char buf[30]; |
74 snprintf(buf, llvm::array_lengthof(buf), "%2u", | 74 snprintf(buf, llvm::array_lengthof(buf), "%2d", |
John
2016/04/06 16:36:14
What about printing None instead of -1?
Jim Stichnoth
2016/04/06 17:04:37
I tried that, but then I realized that the whole s
| |
75 unsigned(Var->getRegNumTmp())); | 75 int32_t(Var->getRegNumTmp())); |
76 Str << "R=" << buf << " V="; | 76 Str << "R=" << buf << " V="; |
77 Var->dump(Func); | 77 Var->dump(Func); |
78 Str << " Range=" << Var->getLiveRange(); | 78 Str << " Range=" << Var->getLiveRange(); |
79 } | 79 } |
80 | 80 |
81 int32_t findMinWeightIndex( | 81 int32_t findMinWeightIndex( |
82 const SmallBitVector &RegMask, | 82 const SmallBitVector &RegMask, |
83 const llvm::SmallVector<RegWeight, LinearScan::REGS_SIZE> &Weights) { | 83 const llvm::SmallVector<RegWeight, LinearScan::REGS_SIZE> &Weights) { |
84 int MinWeightIndex = -1; | 84 int MinWeightIndex = -1; |
85 for (RegNumT i : RegNumBVIter(RegMask)) { | 85 for (RegNumT i : RegNumBVIter(RegMask)) { |
(...skipping 923 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 |