[Mlir-commits] [mlir] [MLIR][Conversion] XeGPU to XeVM: create_nd_tdesc - Add support for base memory rank > 2 (PR #164701)
Sang Ik Lee
llvmlistbot at llvm.org
Fri Oct 24 10:42:07 PDT 2025
silee2 wrote:
Agree with @charithaintc that `create_nd_tdesc` is a burden.
MemRef-like information - base addr, offset, shape, strides - can be carried to two different ways. Static and dynamic.
For memref types, static information is carried as part of type and as such visible in print form. As they are carried as part of type, passes have access to it and use it for compile time optimization.
Information in dynamic case is carried through a runtime payload. For example, at LLVM dialect level, ranked memrefs and unranked memrefs are handled like https://mlir.llvm.org/docs/TargetLLVMIR/#default-calling-convention-for-ranked-memref
https://mlir.llvm.org/docs/TargetLLVMIR/#default-calling-convention-for-unranked-memref
Accessing info is done at runtime by extracting payload fields.
Issue with `create_nd_tdesc` is, it cut offs the static information channel completely.
Payload is the only solution that works for all cases including block arg and func arg.
Then, why not to just use payload? It prevents static optimizations and is bad for performance. Typical XeGPU usage is more often static rather than dynamic.
This PR tries to work around that issue by forwarding static values from operands/attributes of create_nd_tdesc directly to the consumer ops to compensate for the disconnected static information channel.
But as @charithaintc pointed out, forwarding becomes challenging in case of control flow and function calls. That is why runtime payload/structure is used as a general solution for memref type.
Deprecating `create_nd_tdesc` op and feed memref directy to consumer ops will solve the issue for memref based source memory but XeGPU would still need an op to create a memref from integer base address, offset, shape and strides that can works for both static and dynamic cases.
https://github.com/llvm/llvm-project/pull/164701
More information about the Mlir-commits
mailing list