dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.08k stars 4.7k forks source link

Investigate the heuristics for creating DummyDef in LSRA #71539

Open kunalspathak opened 2 years ago

kunalspathak commented 2 years ago

Today, if there is a CSE candidate has definition in the middle of deeply nested loop, we end up adding DummyDef refpositions in blocks that doesn't have its uses and that leads to spilling/reloading such variables without need. This happens because of the way we choose the predecessor of such blocks and we should revisit to see if we can also accommodate the variable location where it is defined instead of just checking the block's flow. Relevant discussion in https://github.com/dotnet/runtime/pull/70271#issuecomment-1167949183

category:design theme:register-allocator skill-level:expert cost:small impact:medium

dotnet-issue-labeler[bot] commented 2 years ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

ghost commented 2 years ago

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch See info in area-owners.md if you want to be subscribed.

Issue Details
Today, if there is a CSE candidate has definition in the middle of deeply nested loop, we end up adding `DummyDef` refpositions in blocks that doesn't have its uses and that leads to spilling/reloading such variables without need. This happens because of the way we choose the predecessor of such blocks and we should revisit to see if we can also accommodate the variable location where it is defined instead of just checking the block's flow. Relevant discussion in https://github.com/dotnet/runtime/pull/70271#issuecomment-1167949183
Author: kunalspathak
Assignees: kunalspathak
Labels: `area-CodeGen-coreclr`
Milestone: 8.0.0