[all-commits] [llvm/llvm-project] a8a524: [mlir][XeGPU] Fix crash in wg-to-sg type converter...

Mehdi Amini via All-commits all-commits at lists.llvm.org
Tue Mar 3 03:21:44 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a8a5242bb2dc2949e148e7000230d479be321def
      https://github.com/llvm/llvm-project/commit/a8a5242bb2dc2949e148e7000230d479be321def
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2026-03-03 (Tue, 03 Mar 2026)

  Changed paths:
    M mlir/lib/Dialect/XeGPU/Transforms/XeGPUWgToSgDistribute.cpp
    M mlir/test/Dialect/XeGPU/xegpu-wg-to-sg.mlir

  Log Message:
  -----------
  [mlir][XeGPU] Fix crash in wg-to-sg type converter on non-XeGPU tensors (#183914)

The SCF structural type conversion in XeGPUWgToSgDistributePass
registered a RankedTensorType conversion callback that unconditionally
called VectorType::get() on the tensor's shape. If the tensor had
dynamic dimensions (e.g. tensor<?xi32>) and no XeGPU layout encoding,
getSgShapeAndCount() returned the original shape intact (including the
kDynamic sentinel value), causing VectorType::get() to abort because
VectorType does not support dynamic sizes.

Fix by checking whether the RankedTensorType carries an XeGPU LayoutAttr
encoding before attempting the conversion. Plain tensors without such an
encoding are left unchanged (std::nullopt causes the passthrough
converter to handle them).

Add a regression test for the no-encoding / dynamic-tensor case.

Fixes #182999



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list