-
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
unblock cloning of loops where the header is a try begin #108604
unblock cloning of loops where the header is a try begin #108604
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
@jakobbotsch semi-hacky fix for #96887. Frequently unblocks cloning of foreach over
and this gives some small perf wins as we can avoid the Enumerator GDVs within the "hot" loop.
"Ratio" is comparing to a for loop, so we're still paying a lot for not being able to promote the enumerator. |
Some very large size increases in the PGO collections, from GDV-driven cloning. Seems like we may need to put some rudimentary profitability heuristics on cloning to keep this under control. Some size improvements from layout and some new loop hoisting / cse. Jakob has also suggested doing the complementary thing when the loop crosses a try -- putting the try inside the loop (with header and backedge sources outside) instead of putting the loop inside the try. |
Merging to pick up #108771 |
@jakobbotsch PTAL |
src/coreclr/jit/optimizer.cpp
Outdated
{ | ||
if (backedgeSource->hasTryIndex()) | ||
{ | ||
preheaderEHRegion = backedgeSource->getTryIndex(); |
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.
Previously we were using ehTrueEnclosingTryIndexIL
here, but not anymore. Was it unnecessary?
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, it was arguably better.
If there is a backedge source in a non-contained EH region we should use the true enclosing region of the header to vet any existing preheader, rather than a region based on the backedge source.
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.
Updated. No diffs (locally, x64) from the previous version.
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 with a question
…RegionStart' into EnableCloningWhenLoopHeaderIsTryRegionStart
No description provided.