chore(ssa refactor): Add pass to simplify the control flow graph#1373
Merged
joss-aztec merged 5 commits intomasterfrom May 22, 2023
Merged
chore(ssa refactor): Add pass to simplify the control flow graph#1373joss-aztec merged 5 commits intomasterfrom
joss-aztec merged 5 commits intomasterfrom
Conversation
jfecher
commented
May 18, 2023
joss-aztec
reviewed
May 22, 2023
Contributor
joss-aztec
left a comment
There was a problem hiding this comment.
The code seems to imply that there should be some sort of try_inline_into_predecessor failure handling, but currently ignores it. Were you maybe intending to add some info logging?
joss-aztec
approved these changes
May 22, 2023
TomAFrench
added a commit
that referenced
this pull request
May 24, 2023
* master: chore(ssa refactor): Add loop unrolling pass (#1364) chore: Add terms added in ssa refactor to `cspell` (#1385) chore(ssa refactor): Optimize constant `jmpif`s into `jmp`s (#1374) feat: Allow warnings by default (#1383) chore(github): Update GitHub Pull Request Template (#1370) chore(github): Update GitHub Bug Report Template (#1368) chore(ssa refactor): Update mem2reg pass to work with multiple functions and blocks (#1375) chore(ssa refactor): Add pass to simplify the control flow graph (#1373) chore(github): Update GitHub Feature Request Template (#1369)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue(s)
Resolves #
Description
Summary of changes
Adds a simple pass to simplify a function's CFG by inlining a block into its predecessor if that block only has 1 predecessor and that predecessor's only successor is that block. Example before this pass:
And after the pass:
In the future this pass is expected to perform some other quick tasks like unreachable block elimination. I favored getting this PR out earlier and smaller so that each extra feature could be a separate, easier to review PR.
This pass' name and functionality was inspired by llvm's pass of the same name: https://llvm.org/docs/Passes.html#simplifycfg-simplify-the-cfg.
Dependency additions / changes
Test additions / changes
Checklist
cargo fmtwith default settings.Documentation needs
Additional context