Fix the bug in canonicalize-live-in pass#117
Merged
tancheng merged 6 commits intocoredac:mainfrom Aug 21, 2025
Merged
Conversation
tancheng
approved these changes
Aug 20, 2025
tancheng
reviewed
Aug 20, 2025
tancheng
reviewed
Aug 20, 2025
tancheng
reviewed
Aug 20, 2025
tancheng
approved these changes
Aug 21, 2025
ShangkunLi
pushed a commit
that referenced
this pull request
Mar 12, 2026
Fix the bug in canonicalize-live-in pass
ShangkunLi
pushed a commit
that referenced
this pull request
Mar 12, 2026
Fix the bug in canonicalize-live-in pass
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.
In previous
--canonicalize-live-inpass, we traverse the blocks in topological order. But for case like:When we identify the
%2inbb2as a live-in and wrap it in the block arguments ofbb2and update corresponding operands ofneura.cond_brinbb1. Now%2is also inneura.cond_brand thus a live-in forbb1. But current implementation fails to update the block arguments ofbb1.Thus current implementation results in:
Therefore, in this pr:
--canonicalize-live-inpassphi-grant_predicate-ctrl_movchain--fuse-control-flowin the future. Since they are generated by our canonicalization, they have regular dependencies and are easy to remove.And the new canonicalized ir looks like: