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: Optimize liveness fixpoint computation #89328

Merged
merged 3 commits into from
Aug 28, 2023

Conversation

jakobbotsch
Copy link
Member

When propagating liveness as part of the fixpoint computation we union the live-in state of all successors into the live-out state. We then further handle EH successors more conservatively since control can flow to those from any point in the BB.

The all-successors include successors from two additional sources compared to the regular successors:

  1. They include the EH successors, but we already handle these conservatively later, so this is unnecessary.
  2. They include EH successors of regular successors, but this liveness is already contributed from the regular successors since they will contain it in their live-in state at some point during the fixpoint computation.

Thus we can switch the first loop in liveness to only look at regular successors.

When propagating liveness as part of the fixpoint computation we union
the live-in state of all successors into the live-out state. We then
further handle EH successors more conservatively since control can flow
to those from any point in the BB.

The all-successors include successors from two additional sources
compared to the regular successors:
1. They include the EH successors, but we already handle these
   conservatively later, so this is unnecessary.
2. They include EH successors of regular successors, but this liveness
   is already contributed from the regular successors since they will
   contain it in their live-in state at some point during the fixpoint
   computation.

Thus we can switch the first loop in liveness to only look at regular
successors.
@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 21, 2023
@ghost ghost assigned jakobbotsch Jul 21, 2023
@ghost
Copy link

ghost commented Jul 21, 2023

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

Issue Details

When propagating liveness as part of the fixpoint computation we union the live-in state of all successors into the live-out state. We then further handle EH successors more conservatively since control can flow to those from any point in the BB.

The all-successors include successors from two additional sources compared to the regular successors:

  1. They include the EH successors, but we already handle these conservatively later, so this is unnecessary.
  2. They include EH successors of regular successors, but this liveness is already contributed from the regular successors since they will contain it in their live-in state at some point during the fixpoint computation.

Thus we can switch the first loop in liveness to only look at regular successors.

Author: jakobbotsch
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@jakobbotsch
Copy link
Member Author

/azp run runtime-coreclr superpmi-diffs

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jakobbotsch jakobbotsch reopened this Aug 16, 2023
@jakobbotsch
Copy link
Member Author

/azp run runtime-coreclr jitstress, runtime-coreclr libraries-jitstress

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@jakobbotsch jakobbotsch marked this pull request as ready for review August 25, 2023 19:05
@jakobbotsch
Copy link
Member Author

cc @dotnet/jit-contrib PTAL @BruceForstall

No diffs except for good TP improvements (e.g. -1.3% in asp.net win-x64).

Copy link
Member

@BruceForstall BruceForstall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jakobbotsch jakobbotsch merged commit a7d4b4b into dotnet:main Aug 28, 2023
127 checks passed
@jakobbotsch jakobbotsch deleted the liveness-visit-regular-succs branch August 28, 2023 08:13
@ghost ghost locked as resolved and limited conversation to collaborators Sep 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants