-
Notifications
You must be signed in to change notification settings - Fork 2.6k
[2.2] Port some changes relevant to tiered compilation to 2.2 #20265
Conversation
m_optTier(NativeCodeVersion::OptimizationTier0), | ||
#ifdef FEATURE_TIERED_COMPILATION | ||
m_optTier(optimizationTier), | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I don't think this will compile if FEATURE_TIERED_COMPILATION
is not defined. Not sure if it is worth fixing though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looked like m_optTier
is defined under FEATURE_TIERED_COMPILATION
so I thought that it would not compile without the define before the change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, should have been more specific -- OptimizationTier
is only defined under FEATURE_TIERED_COMPILATION
, so it is the argument list where the problem arises, not the initializer list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ok, I had moved that out of the define here: https://github.com/dotnet/coreclr/pull/20265/files#diff-3fc5234394621d5eb9524166a67ddd82R67 due to some paths that are outside the define needing to refer to it, though it won't actually be stored or used without the define. There's probably a better way to do it but I had settled on that at the time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see. I think it's fine how you have it ... varying signatures based on defines is always annoying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@dotnet-bot test CentOS7.1 x64 Checked Innerloop Build and Test |
Fixes https://github.com/dotnet/coreclr/issues/19954 - `SetTargetInterlocked` can be soon followed by `ResetTargetInterlocked`, so the assert at the end of `SetTargetInterlocked` is invalid - Removed the assert and instead just verified that the specified target is not the default prestub target
The appropriate environment variables were not being set due to a name mismatch
…20009) Add MethodImplOptions.AggressiveOptimization and use it for tiering Part of fix for https://github.com/dotnet/corefx/issues/32235 Workaround for https://github.com/dotnet/coreclr/issues/19751 - Added and set CORJIT_FLAG_AGGRESSIVE_OPT to indicate that a method is flagged with AggressiveOptimization - For a method flagged with AggressiveOptimization, tiering uses a foreground tier 1 JIT on first call to the method, skipping the tier 0 JIT and call counting - When tiering is disabled, a method flagged with AggressiveOptimization does not use r2r-pregenerated code - R2r crossgen does not generate code for a method flagged with AggressiveOptimization
@dotnet-bot test OSX10.12 x64 Checked Innerloop Build and Test |
@dotnet-bot test this please |
Rejected for 2.2 but approved for 3.0. |
Port of the following PRs to 2.2:
Description
Ports of #20007 and #20010 don't affect shipping code.
#20009 - Add MethodImplOptions.AggressiveOptimization and use it for tiering
MethodImplOptions.AggressiveOptimization
to be used in aMethodImplAttribute
to indicate that the method contains hot codeAggressiveOptimization
, tiering uses a foreground tier 1 JIT on first call to the method, skipping the tier 0 JIT and call countingAggressiveOptimization
, such that it will be jitted at run-time, whether tiering is enabled or notAggressiveOptimization
flagaggressiveoptimization
to IL ASM:Customer impact
AggressiveOptimization
AggressiveOptimization
will be jitted with optimizations at run-timeRegression?
Packaging reviewed?
Yes, no impact (coreclr only)
Risk
AggressiveOptimization
AggressiveOptimization
flag without error, but would ignore the flagAggressiveOptimization
flag without error, but strips the flagaggressiveoptimization
keyword, this is by design