-
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
Propagate delegate loads during inlining #109715
base: main
Are you sure you want to change the base?
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
@MihuBot -dependsOn 109679 |
@MihuBot -dependsOn 109679 |
Can you explain why this limits |
As seen in #108579, propagating everything leads to regressions due to CSE not being able to deduplicate all the new loads. This is not as much of an issue for delegates since those are usually single use and the benefit from better inlining of them outweighs any missed cases of duplicated loads. |
I don't see how that couldn't be an issue with delegates, e.g. void Foo(delegate o, bool condition)
{
if (condition)
{
use1(o);
}
else
{
use2(o);
}
} in this case CSE won't be able to handle it, so you'd create two indirs here, not sure it's a big problem just FYI. I am not against this change, just that the diffs are quite big and we need to inspect them rather than blaming inliner. Let's see the SPMI diffs. Also, didn't we agreed that we shouldn't touch |
The idea is that all nullchecks will be folded away while calls will be removed by #109679 so only other operations might end up with duplicated loads but those should be more rare.
We agreed on only putting it in |
Propagate delegate loads from static readonly by value when inlining to avoid spilling them.
Alternative of #108579, needed for #109679.