IncrementalCompact: fix display of basic block boundaries.#47043
Merged
IncrementalCompact: fix display of basic block boundaries.#47043
Conversation
Keno
approved these changes
Oct 4, 2022
Member
Keno
left a comment
There was a problem hiding this comment.
Good enough for now, I think. To my mind, the most important thing here is to get in test cases for all the interesting cases, so we have a spec for what should happen next time we take a pick refactor to this.
Member
Author
|
OK. I didn't want to start out with substantial changes as I'm not very familiar with this code yet, but feel free to suggest things to refactor. |
Keno
added a commit
that referenced
this pull request
Oct 12, 2022
Slight fix to #47043 for the case where nodes where inserted using `insert_node_here!`.
Keno
added a commit
that referenced
this pull request
Oct 12, 2022
Slight fix to #47043 for the case where nodes where inserted using `insert_node_here!`.
DilumAluthge
pushed a commit
that referenced
this pull request
Oct 13, 2022
Slight fix to #47043 for the case where nodes where inserted using `insert_node_here!`.
aviatesk
pushed a commit
that referenced
this pull request
Oct 13, 2022
Slight fix to #47043 for the case where nodes where inserted using `insert_node_here!`.
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.
Fixes #46424 again, as the first attempt in #46644 was insufficient.
The problem with CFGs during incremental compaction is that the basic block boundaries are not properly determined until after compaction. We rely on
finish_current_bb!to finalize a bb, but that only triggers when we've seen all the statements in a block. That's a problem when displaying part of a compacted block, resulting in an incorrectbb_idxand display breaking down:Similarly,
finish_current_bb!also updates the start statement index of the next basic block. That's a problem when the boundary of the compacted and uncompacted nodes is at the boundary of two basic blocks, because we then callshow_ir_stmtswith a CFG where the current active block has a broken statement range (the start is an index intoresult_bbs, while the end is still an index into the original instruction stream).I don't particularly like the patching-up of CFGs in
show_ir, but the alternative (changing howfinalize_current_bb!works and is invoked) seemed like a way more riskier change.