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

Unified Diff: src/IceTargetLoweringX8632.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 | « src/IceInstX8632.h ('k') | src/IceTranslator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLoweringX8632.cpp
diff --git a/src/IceTargetLoweringX8632.cpp b/src/IceTargetLoweringX8632.cpp
index ec0dc3fbde9727ab525d0704691df34df228519c..7bdb507b6aff9be447a83eb6de0d224058c984c9 100644
--- a/src/IceTargetLoweringX8632.cpp
+++ b/src/IceTargetLoweringX8632.cpp
@@ -606,6 +606,11 @@ void TargetX8632::finishArgumentLowering(Variable *Arg, Variable *FramePtr,
} else {
_mov(Arg, Mem);
}
+ // This argument-copying instruction uses an explicit
+ // OperandX8632Mem operand instead of a Variable, so its
+ // fill-from-stack operation has to be tracked separately for
+ // statistics.
+ Ctx->statsUpdateFills();
}
}
@@ -746,13 +751,16 @@ void TargetX8632::addProlog(CfgNode *Node) {
SpillAreaSizeBytes += GlobalsSize;
// Add push instructions for preserved registers.
+ uint32_t NumCallee = 0;
for (SizeT i = 0; i < CalleeSaves.size(); ++i) {
if (CalleeSaves[i] && RegsUsed[i]) {
+ ++NumCallee;
PreservedRegsSizeBytes += 4;
const bool SuppressStackAdjustment = true;
_push(getPhysicalRegister(i), SuppressStackAdjustment);
}
}
+ Ctx->statsUpdateRegistersSaved(NumCallee);
// Generate "push ebp; mov ebp, esp"
if (IsEbpBasedFrame) {
@@ -800,6 +808,7 @@ void TargetX8632::addProlog(CfgNode *Node) {
if (SpillAreaSizeBytes)
_sub(getPhysicalRegister(Reg_esp),
Ctx->getConstantInt(IceType_i32, SpillAreaSizeBytes));
+ Ctx->statsUpdateFrameBytes(SpillAreaSizeBytes);
resetStackAdjustment();
« no previous file with comments | « src/IceInstX8632.h ('k') | src/IceTranslator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698