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

Side by Side Diff: src/IceOperand.cpp

Issue 691693003: Subzero: Improve the representation and handling of the FakeKill instruction. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Add an assert 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
« no previous file with comments | « src/IceInst.cpp ('k') | src/IceTargetLoweringX8632.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/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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 const bool IsFromDef = false; 343 const bool IsFromDef = false;
344 const bool IsImplicit = false; 344 const bool IsImplicit = false;
345 Metadata[VarNum].markUse(Kind, I, Node, IsFromDef, IsImplicit); 345 Metadata[VarNum].markUse(Kind, I, Node, IsFromDef, IsImplicit);
346 } 346 }
347 } 347 }
348 } 348 }
349 349
350 for (Inst *I : Node->getInsts()) { 350 for (Inst *I : Node->getInsts()) {
351 if (I->isDeleted()) 351 if (I->isDeleted())
352 continue; 352 continue;
353 if (InstFakeKill *Kill = llvm::dyn_cast<InstFakeKill>(I)) { 353 // Note: The implicit definitions (and uses) from InstFakeKill are
354 // A FakeKill instruction indicates certain Variables (usually 354 // deliberately ignored.
355 // physical scratch registers) are redefined, so we register
356 // them as defs.
357 for (SizeT SrcNum = 0; SrcNum < I->getSrcSize(); ++SrcNum) {
358 Variable *Var = llvm::cast<Variable>(I->getSrc(SrcNum));
359 SizeT VarNum = Var->getIndex();
360 assert(VarNum < Metadata.size());
361 Metadata[VarNum].markDef(Kind, Kill, Node);
362 }
363 continue; // no point in executing the rest
364 }
365 if (Variable *Dest = I->getDest()) { 355 if (Variable *Dest = I->getDest()) {
366 SizeT DestNum = Dest->getIndex(); 356 SizeT DestNum = Dest->getIndex();
367 assert(DestNum < Metadata.size()); 357 assert(DestNum < Metadata.size());
368 Metadata[DestNum].markDef(Kind, I, Node); 358 Metadata[DestNum].markDef(Kind, I, Node);
369 } 359 }
370 for (SizeT SrcNum = 0; SrcNum < I->getSrcSize(); ++SrcNum) { 360 for (SizeT SrcNum = 0; SrcNum < I->getSrcSize(); ++SrcNum) {
371 Operand *Src = I->getSrc(SrcNum); 361 Operand *Src = I->getSrc(SrcNum);
372 SizeT NumVars = Src->getNumVars(); 362 SizeT NumVars = Src->getNumVars();
373 for (SizeT J = 0; J < NumVars; ++J) { 363 for (SizeT J = 0; J < NumVars; ++J) {
374 const Variable *Var = Src->getVar(J); 364 const Variable *Var = Src->getVar(J);
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 508
519 Ostream &operator<<(Ostream &Str, const RegWeight &W) { 509 Ostream &operator<<(Ostream &Str, const RegWeight &W) {
520 if (W.getWeight() == RegWeight::Inf) 510 if (W.getWeight() == RegWeight::Inf)
521 Str << "Inf"; 511 Str << "Inf";
522 else 512 else
523 Str << W.getWeight(); 513 Str << W.getWeight();
524 return Str; 514 return Str;
525 } 515 }
526 516
527 } // end of namespace Ice 517 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceInst.cpp ('k') | src/IceTargetLoweringX8632.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698