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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/IceClFlags.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCfgNode.cpp
diff --git a/src/IceCfgNode.cpp b/src/IceCfgNode.cpp
index f6b4a98b46bae12bbeb9fccf87b0587999654089..4de2f577db3c4cbaedbf0939947b8d20fb08e3e1 100644
--- a/src/IceCfgNode.cpp
+++ b/src/IceCfgNode.cpp
@@ -483,6 +483,21 @@ void CfgNode::emit(Cfg *Func) const {
if (Inst->isRedundantAssign())
continue;
(*I)->emit(Func);
+ // Update emitted instruction count, plus fill/spill count for
+ // Variable operands without a physical register.
+ if (uint32_t Count = (*I)->getEmitInstCount()) {
+ Func->getContext()->statsUpdateEmitted(Count);
+ if (Variable *Dest = (*I)->getDest()) {
+ if (!Dest->hasReg())
+ Func->getContext()->statsUpdateFills();
+ }
+ for (SizeT S = 0; S < (*I)->getSrcSize(); ++S) {
+ if (Variable *Src = llvm::dyn_cast<Variable>((*I)->getSrc(S))) {
+ if (!Src->hasReg())
+ Func->getContext()->statsUpdateSpills();
+ }
+ }
+ }
}
}
« 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