You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If it's not helping with code gen and it's not helping to improve the JIT's throughput in any meaningful way or otherwise helping with anything, let's delete it :)
If it's not helping with code gen and it's not helping to improve the JIT's throughput in any meaningful way or otherwise helping with anything, let's delete it :)
Ah makes sense, it probably slightly improves JIT's throughput for this specific method but unlikely it's worth additional code in C# 🙂
Activity
am11 commentedon Dec 1, 2022
Thanks. The non-generic version is also slightly inefficient: https://godbolt.org/z/cW47njasd.
stephentoub commentedon Dec 1, 2022
I assume fixing this would enable this to be removed?
runtime/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs
Line 5232 in fe85cd4
EgorBo commentedon Dec 1, 2022
Yep, I have a fix already but it requires another JIT-EE update so I can't use SPMI to get diffs and have to run it locally 😞
EgorBo commentedon Dec 1, 2022
@stephentoub hm.. actually your case should be foldable as is 🤔 e.g.:
This issue is mostly about a case where a local is introduced.
stephentoub commentedon Dec 1, 2022
That line was added a decade ago (or, at least, it's evolved from one that was):
https://referencesource.microsoft.com/#mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs,737
If it's not helping with code gen and it's not helping to improve the JIT's throughput in any meaningful way or otherwise helping with anything, let's delete it :)
EgorBo commentedon Dec 1, 2022
Ah makes sense, it probably slightly improves JIT's throughput for this specific method but unlikely it's worth additional code in C# 🙂
EgorBo commentedon Dec 1, 2022
That one must be a different issue - jit pushes generic context for VM, we have an issue for that somewhere (quite old one)