Skip to content
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

JIT should track single-BB locals and multi-BB locals separately #72740

Open
jakobbotsch opened this issue Jul 24, 2022 · 3 comments
Open

JIT should track single-BB locals and multi-BB locals separately #72740

jakobbotsch opened this issue Jul 24, 2022 · 3 comments
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone

Comments

@jakobbotsch
Copy link
Member

jakobbotsch commented Jul 24, 2022

If my measurements are correct then over libraries.pmi, 55% of tracked locals are wholly defined and then used within a single BB:

Total number of non-parameter tracked locals: 1784135
Total number of non-parameter tracked locals wholly defined and only used in a single BB: 990613 (55.5%)

Unless I'm missing something these locals can be tracked separately and per-BB instead of globally in the varsets and should not contribute to the complexity of our dataflow analyses. Thus, we should consider always tracking such locals and not having them count towards the tracked locals limit.

category:cq
theme:profile-feedback

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jul 24, 2022
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jul 24, 2022
@ghost
Copy link

ghost commented Jul 24, 2022

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

Issue Details

If my measurements are correct then over libraries.pmi, 55% of tracked locals are wholly defined and then used within a single BB:

Total number of non-parameter tracked locals: 1784135
Total number of non-parameter tracked locals wholly defined and only used in a single BB: 990613 (55.5%)

Unless I'm missing something these locals can be tracked separately and per-BB instead of globally in the varsets and should not contribute to the complexity of our dataflow analyses. Thus, we should consider always tracking such locals and not having them count towards the tracked locals limit.

Author: jakobbotsch
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@jakobbotsch
Copy link
Member Author

cc @dotnet/jit-contrib

@AndyAyersMS
Copy link
Member

These single-block locals also don't really need to be in SSA, there can be at most one reaching def for each use (modulo some kind of conditional select operator).

The challenge in creating different classes of locals is usually how much of it shows through elsewhere. In my experience it is hard to hide something like this, so many producers / consumers may need to be modified.

There are already vestiges of something like this in the jit -- lvaGrabTemp has a shortLifetime parameter that perhaps once meant that this temp would only be used within a block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

No branches or pull requests

2 participants