Repository navigation
[Codegen] NFC: Lift DataTiledMMA inner_tiled lowering helpers into MMAUtils. - #24326
Merged
Merged
Conversation
…AUtils.
Moves the body of `DataTiledMMAAttr::buildUnderlyingOperations` and its
private helpers (`incrementIndices`, `flattenVector`,
`distributeMmaFragmentToIntrinsics`) out of the GPU dialect into a new
`Codegen/Utils/MMAUtils.{h,cpp}`. The shared
`buildDataTiledMMAUnderlyingOperations` takes a callback for the
architecture-specific MMA op emission, so future CPU support can reuse
everything except the per-intrinsic op creation.
Also consolidates the HoistableConversionOp tag string literals
(kDataTiledAcc{Distribute,Reassemble}, kRdna3{Interleave,Deinterleave}Acc,
kVDMFMA{Interleave,Deinterleave}Acc) into the new header so that paired
tags — which match by string — can no longer drift between translation
units.
GPU's `DataTiledMMAAttr::buildUnderlyingOperations` is now a thin wrapper
that supplies a callback delegating to the existing `createMmaOp`. GPU's
`DataTiledScaledMMAAttr::buildUnderlyingOperations` keeps using the
helpers via `using` declarations.
No functional change for GPU.
Signed-off-by: Benoit Jacob <[email protected]>
Progress towards #24323
25 of 28 tasks
bjacob
marked this pull request as ready for review
April 30, 2026 19:37
bjacob
requested review from
Groverkss,
MaheshRavishankar,
Max191,
krzysz00,
nirvedhmeshram and
qedawkins
as code owners
April 30, 2026 19:37
hanhanW
approved these changes
Apr 30, 2026
bjacob
added a commit
that referenced
this pull request
May 4, 2026
Implements CPU's `DataTiledMMAAttr::buildUnderlyingOperations` by reusing the shared `Codegen::buildDataTiledMMAUnderlyingOperations` from #24326. CPU passes a callback, `createCpuMmaIntrinsicCall`, that emits an `llvm.call_intrinsic` for each per-intrinsic invocation. The function dispatches on the `MMAIntrinsic` enum value through a switch. Progress towards #24323 --------- Co-authored-by: Han-Chung Wang <[email protected]>
jerryyin
pushed a commit
that referenced
this pull request
May 7, 2026
…AUtils. (#24326) Moves the body of `DataTiledMMAAttr::buildUnderlyingOperations` and its private helpers (`incrementIndices`, `flattenVector`, `distributeMmaFragmentToIntrinsics`) out of the GPU dialect into a new `Codegen/Utils/MMAUtils.{h,cpp}`. The shared `buildDataTiledMMAUnderlyingOperations` takes a callback for the architecture-specific MMA op emission, so future CPU support can reuse everything except the per-intrinsic op creation. Also consolidates the HoistableConversionOp tag string literals (kDataTiledAcc{Distribute,Reassemble}, kRdna3{Interleave,Deinterleave}Acc, kVDMFMA{Interleave,Deinterleave}Acc) into the new header so that paired tags — which match by string — can no longer drift between translation units. GPU's `DataTiledMMAAttr::buildUnderlyingOperations` is now a thin wrapper that supplies a callback delegating to the existing `createMmaOp`. GPU's `DataTiledScaledMMAAttr::buildUnderlyingOperations` keeps using the helpers via `using` declarations. No functional change. Progress towards #24323
jerryyin
pushed a commit
that referenced
this pull request
May 7, 2026
Implements CPU's `DataTiledMMAAttr::buildUnderlyingOperations` by reusing the shared `Codegen::buildDataTiledMMAUnderlyingOperations` from #24326. CPU passes a callback, `createCpuMmaIntrinsicCall`, that emits an `llvm.call_intrinsic` for each per-intrinsic invocation. The function dispatches on the `MMAIntrinsic` enum value through a switch. Progress towards #24323 --------- Co-authored-by: Han-Chung Wang <[email protected]>
RattataKing
pushed a commit
to RattataKing/iree
that referenced
this pull request
May 27, 2026
…AUtils. (iree-org#24326) Moves the body of `DataTiledMMAAttr::buildUnderlyingOperations` and its private helpers (`incrementIndices`, `flattenVector`, `distributeMmaFragmentToIntrinsics`) out of the GPU dialect into a new `Codegen/Utils/MMAUtils.{h,cpp}`. The shared `buildDataTiledMMAUnderlyingOperations` takes a callback for the architecture-specific MMA op emission, so future CPU support can reuse everything except the per-intrinsic op creation. Also consolidates the HoistableConversionOp tag string literals (kDataTiledAcc{Distribute,Reassemble}, kRdna3{Interleave,Deinterleave}Acc, kVDMFMA{Interleave,Deinterleave}Acc) into the new header so that paired tags — which match by string — can no longer drift between translation units. GPU's `DataTiledMMAAttr::buildUnderlyingOperations` is now a thin wrapper that supplies a callback delegating to the existing `createMmaOp`. GPU's `DataTiledScaledMMAAttr::buildUnderlyingOperations` keeps using the helpers via `using` declarations. No functional change. Progress towards iree-org#24323
RattataKing
pushed a commit
to RattataKing/iree
that referenced
this pull request
May 27, 2026
) Implements CPU's `DataTiledMMAAttr::buildUnderlyingOperations` by reusing the shared `Codegen::buildDataTiledMMAUnderlyingOperations` from iree-org#24326. CPU passes a callback, `createCpuMmaIntrinsicCall`, that emits an `llvm.call_intrinsic` for each per-intrinsic invocation. The function dispatches on the `MMAIntrinsic` enum value through a switch. Progress towards iree-org#24323 --------- Co-authored-by: Han-Chung Wang <[email protected]>
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.
Moves the body of
DataTiledMMAAttr::buildUnderlyingOperationsand its private helpers (incrementIndices,flattenVector,distributeMmaFragmentToIntrinsics) out of the GPU dialect into a newCodegen/Utils/MMAUtils.{h,cpp}. The sharedbuildDataTiledMMAUnderlyingOperationstakes a callback for the architecture-specific MMA op emission, so future CPU support can reuse everything except the per-intrinsic op creation.Also consolidates the HoistableConversionOp tag string literals (kDataTiledAcc{Distribute,Reassemble}, kRdna3{Interleave,Deinterleave}Acc, kVDMFMA{Interleave,Deinterleave}Acc) into the new header so that paired tags — which match by string — can no longer drift between translation units.
GPU's
DataTiledMMAAttr::buildUnderlyingOperationsis now a thin wrapper that supplies a callback delegating to the existingcreateMmaOp. GPU'sDataTiledScaledMMAAttr::buildUnderlyingOperationskeeps using the helpers viausingdeclarations.No functional change.
Progress towards #24323