[all-commits] [llvm/llvm-project] 400cdf: [mlir][VectorToXeGPU] Lower out-of-bounds 1-D tran...

Jianhui Li via All-commits all-commits at lists.llvm.org
Fri Sep 18 15:46:36 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 400cdf6f379c0177e6259eeaf65ea8efa93326b3
      https://github.com/llvm/llvm-project/commit/400cdf6f379c0177e6259eeaf65ea8efa93326b3
  Author: Jianhui Li <jian.hui.li at intel.com>
  Date:   2026-09-18 (Fri, 18 Sep 2026)

  Changed paths:
    M mlir/lib/Conversion/VectorToXeGPU/VectorToXeGPU.cpp
    M mlir/test/Conversion/VectorToXeGPU/transfer-read-to-xegpu.mlir
    M mlir/test/Conversion/VectorToXeGPU/transfer-write-to-xegpu.mlir

  Log Message:
  -----------
  [mlir][VectorToXeGPU] Lower out-of-bounds 1-D transfers (#220490)

A vector.transfer_read / vector.transfer_write whose vector is 1-D and
whose access is out of bounds was not lowered.

This PR now builds a real in-bounds mask instead of handing
xegpu.load/xegpu.store an all-ones one. An element is in bounds when its
index is still inside the memref dimension it reads, i.e. i < dim(d) -
indices[d], and dimensions the transfer already declares in-bounds are
left alone. Since masked-off lanes of an xegpu.load hold unspecified
values rather than zeros, a read adds an arith.select to fill them with
the transfer's padding.

It also lowers a transfer_read of a single-element vector (any rank) to
a scalar xegpu.load, when that vector is only ever extracted to a
scalar. The load takes a scalar offset and a scalar mask, and the mask
is what keeps an out-of-bounds transfer from touching memory; because a
masked-off load is unspecified, the padding is applied with an
arith.select, as the scattered path already does. This avoids
special-casing single-element vectors in layout propagation: a scalar
consumer requests no layout, so the one-lane xegpu.load would otherwise
be left without one.

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply at anthropic.com>



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