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

Side by Side Diff: src/IceCfgNode.cpp

Issue 580633002: Subzero: Add rudimentary statistics on generated code. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Remove SpillsPlusFills and calculate as Spills+Fills 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
« no previous file with comments | « no previous file | src/IceClFlags.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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 for (InstList::const_iterator I = Insts.begin(), E = Insts.end(); I != E; 476 for (InstList::const_iterator I = Insts.begin(), E = Insts.end(); I != E;
477 ++I) { 477 ++I) {
478 Inst *Inst = *I; 478 Inst *Inst = *I;
479 if (Inst->isDeleted()) 479 if (Inst->isDeleted())
480 continue; 480 continue;
481 // Here we detect redundant assignments like "mov eax, eax" and 481 // Here we detect redundant assignments like "mov eax, eax" and
482 // suppress them. 482 // suppress them.
483 if (Inst->isRedundantAssign()) 483 if (Inst->isRedundantAssign())
484 continue; 484 continue;
485 (*I)->emit(Func); 485 (*I)->emit(Func);
486 // Update emitted instruction count, plus fill/spill count for
487 // Variable operands without a physical register.
488 if (uint32_t Count = (*I)->getEmitInstCount()) {
489 Func->getContext()->statsUpdateEmitted(Count);
490 if (Variable *Dest = (*I)->getDest()) {
491 if (!Dest->hasReg())
492 Func->getContext()->statsUpdateFills();
493 }
494 for (SizeT S = 0; S < (*I)->getSrcSize(); ++S) {
495 if (Variable *Src = llvm::dyn_cast<Variable>((*I)->getSrc(S))) {
496 if (!Src->hasReg())
497 Func->getContext()->statsUpdateSpills();
498 }
499 }
500 }
486 } 501 }
487 } 502 }
488 503
489 void CfgNode::dump(Cfg *Func) const { 504 void CfgNode::dump(Cfg *Func) const {
490 Func->setCurrentNode(this); 505 Func->setCurrentNode(this);
491 Ostream &Str = Func->getContext()->getStrDump(); 506 Ostream &Str = Func->getContext()->getStrDump();
492 Liveness *Liveness = Func->getLiveness(); 507 Liveness *Liveness = Func->getLiveness();
493 if (Func->getContext()->isVerbose(IceV_Instructions)) { 508 if (Func->getContext()->isVerbose(IceV_Instructions)) {
494 Str << getName() << ":\n"; 509 Str << getName() << ":\n";
495 } 510 }
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 I != E; ++I) { 565 I != E; ++I) {
551 if (I != OutEdges.begin()) 566 if (I != OutEdges.begin())
552 Str << ", "; 567 Str << ", ";
553 Str << "%" << (*I)->getName(); 568 Str << "%" << (*I)->getName();
554 } 569 }
555 Str << "\n"; 570 Str << "\n";
556 } 571 }
557 } 572 }
558 573
559 } // end of namespace Ice 574 } // end of namespace Ice
OLDNEW
« no previous file with comments | « no previous file | src/IceClFlags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698