-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JIT: Avoid reporting call-sites in MinOpts on all targets #103950
JIT: Avoid reporting call-sites in MinOpts on all targets #103950
Conversation
When the call-sites have no interesting GC information we avoid reporting them, but this behavior was enabled only for x86/x64. Enable this on other platforms too. Fix dotnet#103917
src/coreclr/jit/gcencode.cpp
Outdated
@@ -4065,13 +4065,7 @@ void GCInfo::gcMakeRegPtrTable( | |||
{ | |||
GCENCODER_WITH_LOGGING(gcInfoEncoderWithLog, gcInfoEncoder); | |||
|
|||
// TODO: Decide on whether we should enable this optimization for all | |||
// targets: https://github.com/dotnet/runtime/issues/103917 | |||
#ifdef TARGET_XARCH | |||
const bool noTrackedGCSlots = compiler->opts.MinOpts() && !compiler->opts.jitFlags->IsSet(JitFlags::JIT_FLAG_PREJIT); |
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.
@jkotas do you know if there is any dependency on the call site locations by crossgen2? I'm not sure if the PREJIT
condition can also be removed here.
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.
I do not think crossgen2 has any dependency on that. NativeAOT might have (unintentional) dependency on it - you may want to run NativeAOT outer loop.
The primary motivation for this feature was JIT throughput improvement. This condition is likely result of that thinking - spending the extra cycles for AOT is no big deal.
I do not see a problem with removing this condition.
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.
The change in https://github.com/dotnet/runtime/pull/102680/files#r1653150895 may make us sensitive to missing safepoints.
Mostly just a matter of changing asserts though. We know the caller site is GC-safe. (since we are in a GC-capable callee)
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.
Do you want me to revert the PREJIT
change for now?
/azp run runtime-nativeaot-outerloop, runtime-coreclr gcstress0x3-gcstress0xc |
Azure Pipelines successfully started running 2 pipeline(s). |
/azp run runtime-nativeaot-outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-coreclr gcstress0x3-gcstress0xc |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-nativeaot-outerloop, runtime-coreclr gcstress0x3-gcstress0xc |
I think we should fix the ILScanner/ If you think we should expand this unconditionally the intrinsic should just be made recursive in the C# sources, right? (Hmm, no.. we don't really have prior art to unconditionally expanded intrinsics in callers outside of NAOT. I would probably suggest we just add this one to the list of ones expanded for NAOT.) |
/azp run runtime-nativeaot-outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
There are bunch of failures on NativeAOT that complain about size increase:
Those are expected, I assume. However there are failures that look more like real failures:
Is that another expectation from the JIT (deadcode elimination), that is not guaranteed by MinOpts? |
Those three failures are due to the forced minopts since they all expect optimizations to happen. Smoketests tend to have tests that test optimizations happen. I think we should run nativeaot outerloop with the forced minopts and ignore all failures in tests that are only failing because of the minopts. There shouldn't be many more tests like that. Unfortunately outerloop is on the floor right now, trying to fix it in #110238. |
Just want to clarify - the failures are only because the tests explicitly check for optimizations (the first case that simply looks for size regressions looks like that). Or if optimizations do not happen the codegen is actually incorrect? I can't tell about |
The I believe the lines:
in this PR currently set minopts for everything (for testing purposes) so branch removal doesn't happen. |
/azp run runtime-nativeaot-outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-nativeaot-outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
I went through all the failures and I do not see any suspicious ones; they all look to be expected failures from turning off optimizations. |
This reverts commit 4390b5c.
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.
Thanks!
When the call-sites have no interesting GC information we avoid reporting them, but this behavior was enabled only for x86/x64. Enable this on other platforms too.
Fix #103917