[AIEX][OLP] resolve WAR dependencies - #1190
Open
F-Stuckmann wants to merge 5 commits into
Open
Conversation
F-Stuckmann
requested review from
SagarMaheshwari99,
abhinay-anubola,
abnikant,
andcarminati,
katerynamuts,
khallouh,
konstantinschwarz,
martien-de-jong,
mludevid,
niwinanto and
stephenneuendorffer
as code owners
July 22, 2026 12:53
F-Stuckmann
force-pushed
the
stuckmann.war.resolver.simple
branch
2 times, most recently
from
July 23, 2026 07:46
5a0ba39 to
c08ec8f
Compare
…nUtils Pull the free-register search out of AIEWawRegRewriter into a shared Utils/AIERegAllocationUtils helper so a second reallocation pass can reuse it. Switch the WAW round-robin from std::list to SmallVector along the way. No functional change to WAW register rewriting.
Add a common physical-copy materialization helper on AIEBaseInstrInfo and implement it for AIE1/AIE2/AIE2P/AIE2PS so downstream passes can emit register copies without duplicating per-subtarget copy-splitting logic.
Introduce the AIEEpilogueRegRewriter pass as a registered no-op and wire it into the AIE2/AIE2P/AIE2PS optimized register-allocation pipelines behind EnableEpilogueRegRewrite (default on), plus a second greedy pass. The pass declares its analysis dependencies but does not yet rename anything. Also register the --aie-epilogue-reg-rewrite-copy-budget and --aie-olp-war-rename options and add the epilogue-reg-rewrite MIR test with CHECK lines capturing the pre-rewrite (before) baseline, so the follow-up that implements the renaming shows a clean before/after diff. Pipeline listing tests updated to include the pass.
Fill in the epilogue register rewriter: collect def-driven WAR candidates (registers read before they are rewritten in a block carrying the aie-olp-war-rename hint), find a free non-overlapping physical register via the shared search helper, and materialize a repair copy that restores the old name at the block end. The copy budget bounds how many renames are taken. Both VLDA- and COPY-defined accumulators are handled. Updates the epilogue-reg-rewrite MIR test CHECK lines to the post-rewrite (after) state, so the diff against the baseline shows exactly what the pass changes.
F-Stuckmann
force-pushed
the
stuckmann.war.resolver.simple
branch
from
July 24, 2026 11:31
c08ec8f to
fea4466
Compare
| ; CHECK-NEXT: vlda bmlh0, [p4], #64; vst.srs.4x dm2, s0, srssign0, [p2], m5; jnzd r1, r1, p5; vshuffle x10, x10, x0, r20 | ||
| ; CHECK-NEXT: vlda bmhl0, [p4], #64; vst.srs.4x dm1, s0, srssign0, [p2], #64; vshuffle x1, x1, x0, r26 // Delay Slot 5 | ||
| ; CHECK-NEXT: vlda bmhh0, [p4], #64; vst.2d.srs.4x dm0, s0, srssign0, [p2], d2; movx srssign0, #0; vmov cml3, cml4 // Delay Slot 4 | ||
| ; CHECK-NEXT: vmov cmh3, cmh4 // Delay Slot 3 |
Collaborator
There was a problem hiding this comment.
Nice 3 cycle reduction.
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 schedule epilogues of Steadystates in the OLP we can remove WriteAfterRead (WAR) dependencies by splitting VRegs and assigning separate PhysRegs to them.
This option has to be enabled by loop hint.