[AIEX] Fix register rewriting failed: cycle in copy bundle#793
Merged
F-Stuckmann merged 2 commits intoaie-publicfrom Mar 12, 2026
Merged
[AIEX] Fix register rewriting failed: cycle in copy bundle#793F-Stuckmann merged 2 commits intoaie-publicfrom
F-Stuckmann merged 2 commits intoaie-publicfrom
Conversation
Collaborator
There was a problem hiding this comment.
nit: superreg (double r)
| LLVM_DEBUG(dbgs() << "Expandable (not rewritable) " | ||
| << printReg(Reg, &TRI, 0, &MRI) << ":" | ||
| << printRegClassOrBank(Reg, MRI, &TRI) << '\n'); | ||
| Info.ExpandableRegs.push_back({Reg, AllSubRegs}); |
Collaborator
There was a problem hiding this comment.
Why don't we just store a pointer to SubRegSplit? That's a const pointer. Now we create three copies, one to populate it, one to create the pair, and one to push it into the vector.
F-Stuckmann
reviewed
Mar 5, 2026
| if (Reg.isPhysical()) | ||
| return false; | ||
|
|
||
| auto &SubRegSplit = TRI.getSubRegSplit(MRI.getRegClass(Reg)->getID()); |
Collaborator
There was a problem hiding this comment.
nit: we could return SubRegSplit as an optional
F-Stuckmann
approved these changes
Mar 11, 2026
0ddfea2 to
337faf4
Compare
Related to the expansion of copy bundles whose reg candidates cannot be rewritten.
Introduce infrastructure to distinguish between expandable and rewritable registers in the AIEUnallocatedSuperRegRewriter pass. Key changes: - Add `isExpandableRegister()` helper to check if a register has a subregister split, consolidating duplicate checks - Replace `RegRewriteInfo` typedef with a struct containing two lists: - `ExpandableRegs`: All registers with SubRegSplit (superset) - `RewritableRegs`: Subset that can be immediately rewritten - Rename `getRewriteCandidates()` to `getRewriteAndExpandCandidates()` to reflect the dual-list approach - Update `expandCopyBundles()` to process all expandable registers - Update `rewriteCandidates()` to process only rewritable registers
337faf4 to
03dd0c0
Compare
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.
To fix the problem, we introduce infrastructure to distinguish between expandable and rewritable registers in the AIEUnallocatedSuperRegRewriter pass.