Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(329)

Side by Side Diff: src/IceRegAlloc.cpp

Issue 692633004: Subzero: Remove Variable::NeedsStackSlot. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Also consider whether Dest needs a stack slot Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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();
110 continue; 109 continue;
111 }
112 // Don't bother if the variable has a null live range, which means 110 // Don't bother if the variable has a null live range, which means
113 // it was never referenced. 111 // it was never referenced.
114 if (Var->getLiveRange().isEmpty()) 112 if (Var->getLiveRange().isEmpty())
115 continue; 113 continue;
116 Var->setNeedsStackSlot();
117 Var->untrimLiveRange(); 114 Var->untrimLiveRange();
118 Unhandled.push_back(Var); 115 Unhandled.push_back(Var);
119 if (Var->hasReg()) { 116 if (Var->hasReg()) {
120 Var->setRegNumTmp(Var->getRegNum()); 117 Var->setRegNumTmp(Var->getRegNum());
121 Var->setLiveRangeInfiniteWeight(); 118 Var->setLiveRangeInfiniteWeight();
122 UnhandledPrecolored.push_back(Var); 119 UnhandledPrecolored.push_back(Var);
123 } 120 }
124 } 121 }
125 struct CompareRanges { 122 struct CompareRanges {
126 bool operator()(const Variable *L, const Variable *R) { 123 bool operator()(const Variable *L, const Variable *R) {
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 Str << "\n"; 572 Str << "\n";
576 } 573 }
577 Str << "++++++ Inactive:\n"; 574 Str << "++++++ Inactive:\n";
578 for (const Variable *Item : Inactive) { 575 for (const Variable *Item : Inactive) {
579 dumpLiveRange(Item, Func); 576 dumpLiveRange(Item, Func);
580 Str << "\n"; 577 Str << "\n";
581 } 578 }
582 } 579 }
583 580
584 } // end of namespace Ice 581 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceOperand.h ('k') | src/IceTargetLoweringX8632.h » ('j') | src/IceTargetLoweringX8632.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698