summaryrefslogtreecommitdiff
path: root/src/jit/compiler.h
diff options
context:
space:
mode:
authorBrian Sullivan <briansul@microsoft.com>2017-03-17 18:42:50 -0700
committerBrian Sullivan <briansul@microsoft.com>2017-03-17 18:54:46 -0700
commit756214424d736aa3f7f57af013b89aac51d6ba78 (patch)
tree5c85a4249e288e3451c8620bcfdbe132f844d9ab /src/jit/compiler.h
parenta761b9b985f60be14deadd9015313f8d2a34033d (diff)
downloadcoreclr-756214424d736aa3f7f57af013b89aac51d6ba78.tar.gz
coreclr-756214424d736aa3f7f57af013b89aac51d6ba78.tar.bz2
coreclr-756214424d736aa3f7f57af013b89aac51d6ba78.zip
Updates for the handling of Profile data in the JIT
Use the type weight_t instead of unsigned when dealing with BasicBlock weights. Added new method getCalledCount to return the number of times that the method was called. Added new method fgProfileRunsCount to return the number of scenario runs for the profile data. Made the method fgIsUsingProfileWeight public instead of protected Renamed fgCalledWeight to fgCalledCount Updated the logic in getBBWeight and added comments explaining how it works.
Diffstat (limited to 'src/jit/compiler.h')
-rw-r--r--src/jit/compiler.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/jit/compiler.h b/src/jit/compiler.h
index 7baba5da23..7d2e66e21a 100644
--- a/src/jit/compiler.h
+++ b/src/jit/compiler.h
@@ -3552,7 +3552,7 @@ public:
bool fgSlopUsedInEdgeWeights; // true if their was some slop used when computing the edge weights
bool fgRangeUsedInEdgeWeights; // true if some of the edgeWeight are expressed in Min..Max form
bool fgNeedsUpdateFlowGraph; // true if we need to run fgUpdateFlowGraph
- BasicBlock::weight_t fgCalledWeight; // count of the number of times this method was called
+ BasicBlock::weight_t fgCalledCount; // count of the number of times this method was called
// This is derived from the profile data
// or is BB_UNITY_WEIGHT when we don't have profile data
@@ -4528,12 +4528,22 @@ protected:
bool fgHaveProfileData();
bool fgGetProfileWeightForBasicBlock(IL_OFFSET offset, unsigned* weight);
+ void fgInstrumentMethod();
+public:
+ // fgIsUsingProfileWeights - returns true if we have real profile data for this method
+ // or if we have some fake profile data for the stress mode
bool fgIsUsingProfileWeights()
{
return (fgHaveProfileData() || fgStressBBProf());
}
- void fgInstrumentMethod();
+
+ // fgProfileRunsCount - returns total number of scenario runs for the profile data
+ // or BB_UNITY_WEIGHT when we aren't using profile data.
+ unsigned fgProfileRunsCount()
+ {
+ return fgIsUsingProfileWeights() ? fgNumProfileRuns : BB_UNITY_WEIGHT;
+ }
//-------- Insert a statement at the start or end of a basic block --------