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

Side by Side Diff: src/IceGlobalContext.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 | « src/IceGlobalContext.h ('k') | src/IceInst.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/IceGlobalContext.cpp - Global context defs ---*- C++ -*-===// 1 //===- subzero/src/IceGlobalContext.cpp - Global context defs ---*- C++ -*-===//
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 defines aspects of the compilation that persist across 10 // This file defines aspects of the compilation that persist across
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 BaseOS << "Unsupported constant type: " << Ty; 369 BaseOS << "Unsupported constant type: " << Ty;
370 llvm_unreachable(BaseOS.str().c_str()); 370 llvm_unreachable(BaseOS.str().c_str());
371 } break; 371 } break;
372 case IceType_void: 372 case IceType_void:
373 case IceType_NUM: 373 case IceType_NUM:
374 break; 374 break;
375 } 375 }
376 llvm_unreachable("Unknown type"); 376 llvm_unreachable("Unknown type");
377 } 377 }
378 378
379 void GlobalContext::dumpStats(const IceString &Name) {
380 if (Flags.DumpStats) {
381 StatsFunction.dump(Name, getStrDump());
382 StatsCumulative.dump("_TOTAL_", getStrDump());
383 }
384 }
385
379 void Timer::printElapsedUs(GlobalContext *Ctx, const IceString &Tag) const { 386 void Timer::printElapsedUs(GlobalContext *Ctx, const IceString &Tag) const {
380 if (Ctx->isVerbose(IceV_Timing)) { 387 if (Ctx->isVerbose(IceV_Timing)) {
381 // Prefixing with '#' allows timing strings to be included 388 // Prefixing with '#' allows timing strings to be included
382 // without error in textual assembly output. 389 // without error in textual assembly output.
383 Ctx->getStrDump() << "# " << getElapsedUs() << " usec " << Tag << "\n"; 390 Ctx->getStrDump() << "# " << getElapsedUs() << " usec " << Tag << "\n";
384 } 391 }
385 } 392 }
386 393
387 } // end of namespace Ice 394 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceGlobalContext.h ('k') | src/IceInst.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698