[Codegen] Add pass to absorb swizzle hints into alloc attributes#24000
Open
Yu-Zhewen wants to merge 1 commit intoiree-org:mainfrom
Open
[Codegen] Add pass to absorb swizzle hints into alloc attributes#24000Yu-Zhewen wants to merge 1 commit intoiree-org:mainfrom
Yu-Zhewen wants to merge 1 commit intoiree-org:mainfrom
Conversation
This was referenced Apr 2, 2026
Part 1/3 of enabling XOR swizzle with software pipelining (iree-org#23919). Adds AbsorbSwizzleHintToAllocPass, which moves swizzle info from SwizzleHintOp to an iree_codegen.swizzle attribute on the defining memref.alloc and erases the hint op. The pass is not yet wired into any pipeline. Assisted-by: Cursor (Claude) Signed-off-by: Yu-Zhewen <zhewenyu@amd.com> Made-with: Cursor
101ac77 to
141f360
Compare
jerryyin
approved these changes
Apr 2, 2026
| static LogicalResult | ||
| absorbSwizzleHintToAlloc(RewriterBase &rewriter, | ||
| IREE::Codegen::SwizzleHintOp hintOp) { | ||
| auto allocOp = hintOp.getOperand().getDefiningOp<memref::AllocOp>(); |
Member
There was a problem hiding this comment.
[Question] Is this guaranteed for allocation to be its immediate parent?
Contributor
There was a problem hiding this comment.
So have we made a decision where to resolve the swizzling? do we resolve it at the memory spot, or at the loading/storing operations?
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.
Part 1/3 of enabling XOR swizzle with pipelining (#23919).
Overall plan:
SwizzleHintOpin the SSA chain blocks bothmemref::multiBufferandscf::pipelineForLoop. The fix absorbs the hint into an alloc attribute before pipelining, preserves it through multi-buffering, then re-inserts hints at leaf users afterward.This PR: Adds
AbsorbSwizzleHintToAllocPass, which moves swizzle info fromSwizzleHintOpto aniree_codegen.swizzleattribute on the definingmemref.allocand erases the hint op. The pass is not yet wired into any pipeline.Assisted-by: Cursor (Claude)