diff options
author | Andy Ayers <andya@microsoft.com> | 2016-03-02 15:21:50 -0800 |
---|---|---|
committer | Andy Ayers <andya@microsoft.com> | 2016-03-04 08:54:48 -0800 |
commit | 07278237ec9470d8885fca486bed899bb2ce0c81 (patch) | |
tree | e11495af08a03dbf9b43ac5c0cbc37c25055be98 /src/jit/inlinepolicy.h | |
parent | 29a1d3eb38d30f8cdc2da9355ff6c9d2f9be9524 (diff) | |
download | coreclr-07278237ec9470d8885fca486bed899bb2ce0c81.tar.gz coreclr-07278237ec9470d8885fca486bed899bb2ce0c81.tar.bz2 coreclr-07278237ec9470d8885fca486bed899bb2ce0c81.zip |
Inline refactoring: convert hints into observations
This change updates the inlining code to use observations in place of
the InlineHints and hint-like things (eg "HasSimd"). A number of new
observations were added in support of this.
The `compInlineeHints` member of the compiler object was removed as
the same information is now tracked by the inline policy. The policy
also now contains most of the weights and combining logic used to
compute the profitabiliy boost for the candidate.
There is one subtle and tricky aspect to the change. For the most part
the hints were ignored during the prejit-root analysis, but the mostly
load-store hint was propagated and influenced the inlines done when
crossgenning mscorlib. See #3482 for more on this particular quirk.
I've preserved this behavior by "passing" the prejit inline result
into `fgFindJumpTargets`. In actuality the result is passed by
temporarily setting the `compInlineResult` compiler member variable.
Then, in `fgFindJumpTargets`, the load-store observation is the only
one not guarded by `compIsForInlining`. In a subsequent change I'll redo
the guards at other observation sites and put the policy aspects of these
observations into the policy object.
This addresses another piece of the work outlined in #3371.
Diffstat (limited to 'src/jit/inlinepolicy.h')
-rw-r--r-- | src/jit/inlinepolicy.h | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/jit/inlinepolicy.h b/src/jit/inlinepolicy.h index 746b1e6b57..42047d1a72 100644 --- a/src/jit/inlinepolicy.h +++ b/src/jit/inlinepolicy.h @@ -40,6 +40,14 @@ public: : InlinePolicy() , inlCompiler(compiler) , inlIsForceInline(false) + , inlIsInstanceCtor(false) + , inlIsFromPromotableValueClass(false) + , inlHasSimd(false) + , inlLooksLikeWrapperMethod(false) + , inlArgFeedsConstantTest(false) + , inlMethodIsMostlyLoadStore(false) + , inlArgFeedsRangeCheck(false) + , inlConstantFeedsConstantTest(false) { // empty } @@ -52,7 +60,10 @@ public: void noteInt(InlineObservation obs, int value) override; void noteDouble(InlineObservation obs, double value) override; - // Policy decisions + // Policy determinations + double determineMultiplier() override; + + // Policy policies bool propagateNeverToRuntime() const override { return true; } #ifdef DEBUG @@ -62,7 +73,7 @@ public: private: // Helper methods - void noteInternal(InlineObservation obs, InlineImpact impact); + void noteInternal(InlineObservation obs); void setFailure(InlineObservation obs); void setNever(InlineObservation obs); @@ -78,7 +89,15 @@ private: // Data members Compiler* inlCompiler; - bool inlIsForceInline; + bool inlIsForceInline :1; + bool inlIsInstanceCtor :1; + bool inlIsFromPromotableValueClass :1; + bool inlHasSimd :1; + bool inlLooksLikeWrapperMethod :1; + bool inlArgFeedsConstantTest :1; + bool inlMethodIsMostlyLoadStore :1; + bool inlArgFeedsRangeCheck :1; + bool inlConstantFeedsConstantTest :1; }; #endif // _INLINE_POLICY_H_ |