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

SSA: Expose phi-read nodes #11198

Merged
merged 5 commits into from
Nov 16, 2022
Merged

SSA: Expose phi-read nodes #11198

merged 5 commits into from
Nov 16, 2022

Conversation

hvitved
Copy link
Contributor

@hvitved hvitved commented Nov 10, 2022

This PR follows up on #10035 by exposing "phi read" definitions in the shared SSA library.

The motivation for exposing phi reads is to be able to avoid the same potential combinatorial explosion that we also avoid by including normal phi nodes in the data flow graph:

  graph TD;
      A-->read_phi;
      B-->read_phi;
      C-->read_phi;
      read_phi-->D;
      read_phi-->E;
      read_phi-->F;
Loading

Assuming that A,...,F read the same underlying variable as read_phi, one can reduce the number of data flow edges from 9 (quadratic) to 6 (linear) by including the read_phi join-point.

This PR does not actually include read-phis in the data flow graph for any languages (follow-up work, e.g. #10927), it merely exposes them.

The old API (which ignores phi-reads) is maintained, and if one wants to take phi-reads into account, the new class DefinitionExt should be used instead of the existing Definition class. Existing predicates for Definition now exist in both the old version and a new Ext-suffixed version for DefinitionExt.

@hvitved hvitved force-pushed the ssa/expose-phi-reads branch 7 times, most recently from 721f329 to 2bd648a Compare November 14, 2022 18:33
@hvitved hvitved added the no-change-note-required This PR does not need a change note label Nov 15, 2022
@hvitved hvitved marked this pull request as ready for review November 15, 2022 10:57
@hvitved hvitved requested review from a team as code owners November 15, 2022 10:57
Copy link
Contributor Author

@hvitved hvitved left a comment

Choose a reason for hiding this comment

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

Note to self: Remember to revert the last "Trigger CI" commit.

Copy link
Contributor

@MathiasVP MathiasVP left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:! The Swift .expected files need to be updated. The scary C++ CI failures can be ignored, although they might be hiding some changes to .expected that need to be accepted.

@github-actions github-actions bot removed the C++ label Nov 16, 2022
@hvitved
Copy link
Contributor Author

hvitved commented Nov 16, 2022

@MathiasVP : I have force-pushed a change that reverts the "trigger CI" commit.

Copy link
Contributor

@MathiasVP MathiasVP left a comment

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C# no-change-note-required This PR does not need a change note Ruby Swift
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants