-
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
Fix poisoning for very large structs #61521
Fix poisoning for very large structs #61521
Conversation
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsFor very large structs poisoning could end up generating instructions Fix #60852
|
@@ -3291,7 +3299,7 @@ void LinearScan::BuildStoreLocDef(GenTreeLclVarCommon* storeLoc, | |||
defCandidates = allRegs(type); | |||
} | |||
#else | |||
defCandidates = allRegs(type); | |||
defCandidates = allRegs(type); |
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.
No idea why clang-tidy wants this changed all of a sudden.
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.
We should consider backporting this one.
Agree. Luckily it only affects code compiled in debug without .zeroinit, but the impact may still be quite large. |
For very large structs (> 64K in size) poisoning could end up generating instructions requiring larger local var offsets than we can handle. This hits IMPL_LIMIT that throws InvalidProgramException. Turn off poisoning for larger structs that require more than 16 movs to also avoid the significant code bloat by the singular movs. This is a less risky version of dotnet#61521 for backporting to .NET 6. Fix dotnet#60852
For very large structs (> 64K in size) poisoning could end up generating instructions requiring larger local var offsets than we can handle. This hits IMPL_LIMIT that throws InvalidProgramException. Turn off poisoning for larger structs that require more than 16 movs to also avoid the significant code bloat by the singular movs. This is a less risky version of #61521 for backporting to .NET 6. Fix #60852
For very large structs (> 64K in size) poisoning could end up generating instructions requiring larger local var offsets than we can handle. This hits IMPL_LIMIT that throws InvalidProgramException. Turn off poisoning for larger structs that require more than 16 movs to also avoid the significant code bloat by the singular movs. This is a less risky version of #61521 for backporting to .NET 6. Fix #60852
For very large structs poisoning could end up generating instructions requiring larger local var offsets than we can handle which would hit an IMPL_LIMIT that throws InvalidProgramException. Switch to using rep stosd (x86/x64)/memset helper (other platforms) when a local needs more than a certain number of mov instructions to poison. Also includes a register allocator change to mark killed registers as modified in addRefsForPhysRegMask instead of by the (usually) calling function, since this function is used directly in the change. Fix dotnet#60852
36429e3
to
27a02d3
Compare
* Disable poisoning for large structs For very large structs (> 64K in size) poisoning could end up generating instructions requiring larger local var offsets than we can handle. This hits IMPL_LIMIT that throws InvalidProgramException. Turn off poisoning for larger structs that require more than 16 movs to also avoid the significant code bloat by the singular movs. This is a less risky version of #61521 for backporting to .NET 6. Fix #60852 * Run jit-format * Add regression test * Update src/coreclr/jit/codegencommon.cpp Co-authored-by: Andy Ayers <[email protected]> * Don't check poisoning for large struct in test Since it's disabled, there is nothing to check. Co-authored-by: Jakob Botsch Nielsen <[email protected]> Co-authored-by: Andy Ayers <[email protected]>
For very large structs poisoning could end up generating instructions
requiring larger local var offsets than we can handle which would hit an
IMPL_LIMIT that throws InvalidProgramException. Switch to using rep
stosd (x86/x64)/memset helper (other platforms) when a local needs more
than a certain number of mov instructions to poison.
Fix #60852