[stinkytofu] Preserve MUBUF scope modifiers through StinkyTofu lowering#6852
Merged
Conversation
Carry rocisa MUBUF scope metadata through StinkyTofu conversion, IR serialization, and assembly emission so scope-qualified buffer operations survive lowering.
AlexBrownAMD
approved these changes
Apr 27, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project status has failed because the head coverage (77.83%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #6852 +/- ##
===========================================
- Coverage 67.40% 67.39% -0.00%
===========================================
Files 1953 1953
Lines 301851 301855 +4
Branches 42289 42289
===========================================
Hits 203434 203434
- Misses 80941 80945 +4
Partials 17476 17476
*This pull request uses carry forward flags. Click here to find out more. 🚀 New features to boost your workflow:
|
cycheng
approved these changes
Apr 27, 2026
KKyang
requested changes
Apr 27, 2026
Contributor
KKyang
left a comment
There was a problem hiding this comment.
String is too hacky. Please change to enum.
Contributor
Thanks for the suggestion. Done in e79e255 |
KKyang
approved these changes
Apr 27, 2026
cycheng
approved these changes
Apr 28, 2026
Ensure real-vaddr MUBUF instructions keep an address modifier when literal zero soffsets are lowered to null, while preserving the off-vaddr form.
cycheng
approved these changes
Apr 30, 2026
Contributor
cycheng
left a comment
There was a problem hiding this comment.
In general LGTM with a small notes :)
Merged
1 task
aledudek
pushed a commit
that referenced
this pull request
May 20, 2026
…ng (#6852) ## Motivation Scope-qualified MUBUF buffer ops (e.g. `scope:SCOPE_DEV`) were silently dropped during rocisa → StinkyTofu lowering, breaking cache-coherence semantics on targets that require explicit scope modifiers. ## Technical Details Carry rocisa MUBUF scope metadata through StinkyTofu conversion, IR serialization, and assembly emission so scope qualified buffer operations survive lowering. - Add `MUBUFScope scope` to `stinkytofu::MUBUFModifiers`. - `convertMUBUFModifiers` forwards `rocisa::CacheScope` as a `stinkytofu::MUBUFScope`. - IR serializer writes/reads `scope = "..."` on `mod.mubuf`. - Asm emitter prints ` scope:<value>` alongside existing `glc`/`sc1`/`nt`. ## Test Plan - rocisa pytest: lower `BufferStore/LoadB32` with `CacheScope.SCOPE_DEV` and check final asm. - StinkyToFu FileCheck: verify `scope` survives IR round-trip. - C++ unit test: drive `StinkyAsmEmitter` directly and assert exact output. ## Test Result All three suites pass; emitted asm contains `scope:SCOPE_DEV` for both load and store. --------- Co-authored-by: Joao P. L. de Carvalho <joao.carvalho@amd.com>
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.
Motivation
Scope-qualified MUBUF buffer ops (e.g.
scope:SCOPE_DEV) were silently dropped during rocisa → StinkyTofu lowering, breaking cache-coherence semantics on targets that require explicit scope modifiers.Technical Details
Carry rocisa MUBUF scope metadata through StinkyTofu conversion, IR serialization, and assembly emission so scope qualified buffer operations survive lowering.
MUBUFScope scopetostinkytofu::MUBUFModifiers.convertMUBUFModifiersforwardsrocisa::CacheScopeas astinkytofu::MUBUFScope.scope = "..."onmod.mubuf.scope:<value>alongside existingglc/sc1/nt.Test Plan
BufferStore/LoadB32withCacheScope.SCOPE_DEVand check final asm.scopesurvives IR round-trip.StinkyAsmEmitterdirectly and assert exact output.Test Result
All three suites pass; emitted asm contains
scope:SCOPE_DEVfor both load and store.