-
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] - Fixed sub-optimal optimization for a % 1
to Zero
#77760
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue Details** Description ** Should resolve: #10956 Simple optimization. Will transform ** Acceptance Criteria **
|
Note there is already an optimization that does this: runtime/src/coreclr/jit/morph.cpp Lines 9872 to 9887 in bdd67af
|
Good catch. Will probably remove it in favor of this since it expands it. |
a % 1
to Zero
@dotnet/jit-contrib This is ready. |
/azp run Fuzzlyn |
Azure Pipelines successfully started running 1 pipeline(s). |
The failures look related |
a % 1
to Zeroa % 1
and a % -1
to Zero
@dotnet/jit-contrib @jakobbotsch This is ready again. |
a % 1
and a % -1
to Zeroa % 1
to Zero
@dotnet/jit-contrib @EgorBo This is ready for review again. We update the value number for the zero node, and we disable the optimization if we are not in global morph when there are side effects. |
@dotnet/jit-contrib ready again |
@dotnet/jit-contrib @jakobbotsch @EgorBo This is ready again too. Fixed a minor issue when setting the integral value for |
src/tests/JIT/opt/Remainder/Regressions/Regression1/Regression1.csproj
Outdated
Show resolved
Hide resolved
…l not happen if optimizations are disabled
@dotnet/jit-contrib This is ready for another round of review, based on our internal discussion yesterday. |
<CLRTestEnvironmentVariable Include="DOTNET_TieredCompilation" Value="0" /> | ||
<CLRTestEnvironmentVariable Include="DOTNET_JITMinOpts" Value="0" /> |
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.
One thing I don't remember:
If we have <HasDisasmCheck>true<...>
, why do we need to clear TieredCompilation/JITMinOpts? Shouldn't the "HasDisasmCheck" logic do that for us?
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.
<HasDisasmCheck>true<...>
does not force any environment variables that affect codegen - so it is up to the test itself to decide them.
Description
Should resolve: #10956
We already did the transformation of
a % 1
, but we ignored it ifop1
had any side effects. This PR should fix that.X64 Diff:
Acceptance Criteria