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

Side by Side Diff: src/IceOperand.cpp

Issue 490333003: Subzero: Fix address mode optimization involving phi temporaries. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Clean up and better document the test Created 6 years, 3 months 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/IceOperand.cpp - High-level operand implementation -----===// 1 //===- subzero/src/IceOperand.cpp - High-level operand 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 Operand class and its target-independent 10 // This file implements the Operand class and its target-independent
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 147
148 void Variable::setDefinition(Inst *Inst, const CfgNode *Node) { 148 void Variable::setDefinition(Inst *Inst, const CfgNode *Node) {
149 if (DefNode == NULL) 149 if (DefNode == NULL)
150 return; 150 return;
151 // Can first check preexisting DefInst if we care about multi-def vars. 151 // Can first check preexisting DefInst if we care about multi-def vars.
152 DefInst = Inst; 152 DefInst = Inst;
153 if (Node != DefNode) 153 if (Node != DefNode)
154 DefNode = NULL; 154 DefNode = NULL;
155 } 155 }
156 156
157 void Variable::resetDefinition() {
158 DefNode = NULL;
159 DefInst = NULL;
160 }
161
157 void Variable::replaceDefinition(Inst *Inst, const CfgNode *Node) { 162 void Variable::replaceDefinition(Inst *Inst, const CfgNode *Node) {
158 DefInst = NULL; 163 DefInst = NULL;
159 setDefinition(Inst, Node); 164 setDefinition(Inst, Node);
160 } 165 }
161 166
162 void Variable::setIsArg(Cfg *Func, bool IsArg) { 167 void Variable::setIsArg(Cfg *Func, bool IsArg) {
163 if (IsArg) { 168 if (IsArg) {
164 IsArgument = true; 169 IsArgument = true;
165 if (DefNode == NULL) 170 if (DefNode == NULL)
166 return; 171 return;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 263
259 Ostream &operator<<(Ostream &Str, const RegWeight &W) { 264 Ostream &operator<<(Ostream &Str, const RegWeight &W) {
260 if (W.getWeight() == RegWeight::Inf) 265 if (W.getWeight() == RegWeight::Inf)
261 Str << "Inf"; 266 Str << "Inf";
262 else 267 else
263 Str << W.getWeight(); 268 Str << W.getWeight();
264 return Str; 269 return Str;
265 } 270 }
266 271
267 } // end of namespace Ice 272 } // end of namespace Ice
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698