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

Side by Side Diff: src/IceCfgNode.cpp

Issue 597003004: Subzero: Automatically infer regalloc preferences and overlap. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes Created 6 years, 2 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
« no previous file with comments | « src/IceCfg.cpp ('k') | src/IceDefs.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceCfgNode.cpp - Basic block (node) implementation -----===// 1 //===- subzero/src/IceCfgNode.cpp - Basic block (node) 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 CfgNode class, including the complexities 10 // This file implements the CfgNode class, including the complexities
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 CfgNode *Target = *I1; 193 CfgNode *Target = *I1;
194 // Consider every Phi instruction at the out-edge. 194 // Consider every Phi instruction at the out-edge.
195 for (PhiList::const_iterator I2 = Target->Phis.begin(), 195 for (PhiList::const_iterator I2 = Target->Phis.begin(),
196 E2 = Target->Phis.end(); 196 E2 = Target->Phis.end();
197 I2 != E2; ++I2) { 197 I2 != E2; ++I2) {
198 Operand *Operand = (*I2)->getOperandForTarget(this); 198 Operand *Operand = (*I2)->getOperandForTarget(this);
199 assert(Operand); 199 assert(Operand);
200 Variable *Dest = (*I2)->getDest(); 200 Variable *Dest = (*I2)->getDest();
201 assert(Dest); 201 assert(Dest);
202 InstAssign *NewInst = InstAssign::create(Func, Dest, Operand); 202 InstAssign *NewInst = InstAssign::create(Func, Dest, Operand);
203 // If Src is a variable, set the Src and Dest variables to
204 // prefer each other for register allocation.
205 if (Variable *Src = llvm::dyn_cast<Variable>(Operand)) {
206 bool AllowOverlap = false;
207 Dest->setPreferredRegister(Src, AllowOverlap);
208 Src->setPreferredRegister(Dest, AllowOverlap);
209 }
210 if (CmpInstDest == Operand) 203 if (CmpInstDest == Operand)
211 Insts.insert(SafeInsertionPoint, NewInst); 204 Insts.insert(SafeInsertionPoint, NewInst);
212 else 205 else
213 Insts.insert(InsertionPoint, NewInst); 206 Insts.insert(InsertionPoint, NewInst);
214 } 207 }
215 } 208 }
216 } 209 }
217 210
218 // Deletes the phi instructions after the loads and stores are placed. 211 // Deletes the phi instructions after the loads and stores are placed.
219 void CfgNode::deletePhis() { 212 void CfgNode::deletePhis() {
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 I != E; ++I) { 572 I != E; ++I) {
580 if (I != OutEdges.begin()) 573 if (I != OutEdges.begin())
581 Str << ", "; 574 Str << ", ";
582 Str << "%" << (*I)->getName(); 575 Str << "%" << (*I)->getName();
583 } 576 }
584 Str << "\n"; 577 Str << "\n";
585 } 578 }
586 } 579 }
587 580
588 } // end of namespace Ice 581 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceCfg.cpp ('k') | src/IceDefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698