[all-commits] [llvm/llvm-project] 40e85f: [MLIR][XeGPU][VectorToXeGPU] Fix transfer_read/wri...

Aiden Grossman via All-commits all-commits at lists.llvm.org
Thu Sep 11 18:50:50 PDT 2025


  Branch: refs/heads/users/boomanaiden154/main.clang-port-ulimit-tests-to-work-with-internal-shell
  Home:   https://github.com/llvm/llvm-project
  Commit: 40e85fcaaa04515e511c2a2a8899e46bd6c300ba
      https://github.com/llvm/llvm-project/commit/40e85fcaaa04515e511c2a2a8899e46bd6c300ba
  Author: Dmitry Chigarev <dmitry.chigarev at intel.com>
  Date:   2025-09-11 (Thu, 11 Sep 2025)

  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][XeGPU][VectorToXeGPU] Fix transfer_read/write cases with non-contiguous memrefs (#158126)

This PR fixes a case where a source memref in
`vector.transfer_read/write` is not contiguous, which violates the
`memref.collapse_shape` semantic that is used in the lowering.

<details><summary>An example of a failing test</summary>

```mlir
gpu.module @xevm_module {
gpu.func @load_from_subview(%source: memref<4096x4096xf16>, %off1: index, %off2: index) -> vector<8xf16> {
  %c0 = arith.constant 0.0 : f16
  %subview = memref.subview %source[%off1, %off2] [256, 256] [1, 1] : memref<4096x4096xf16> to memref<256x256xf16, strided<[4096, 1], offset: ?>>
  %0 = vector.transfer_read %subview[%off2, %off2], %c0
    {in_bounds = [true]} : memref<256x256xf16, strided<[4096, 1], offset: ?>>, vector<8xf16>
  gpu.return %0 : vector<8xf16>
}
}
```

Fails with:
```
/home/user/llvm/mlir/test/Conversion/VectorToXeGPU/transfer-read-to-xegpu.mlir:404:8: error: 'memref.collapse_shape' op invalid source layout map or collapsing non-contiguous dims
  %0 = vector.transfer_read %subview[%off2, %off2], %c0
       ^
/home/user/llvm/mlir/test/Conversion/VectorToXeGPU/transfer-read-to-xegpu.mlir:404:8: note: see current operation: %8 = "memref.collapse_shape"(%2) <{reassociation = [[0, 1]]}> : (memref<256x256xf16, strided<[4096, 1], offset: ?>>) -> memref<65536xf16>
```

</details>

A suggestion was to replace `memref.collapse_shape` with
`memref.extract_aligned_pointer_as_index` which is done in this PR.
Since `extract_aligned_pointer` applied to a subview returns an original
pointer without subview offsets, this PR also adds a logic to use an
offset obtained from `memref.extract_strided_metadata` in `baseOffset`
calculation in `computeOffsets`.

---------

Signed-off-by: dchigarev <dmitry.chigarev at intel.com>


  Commit: 3ade8746ee66ad1394c9b5847a86fc326a942d06
      https://github.com/llvm/llvm-project/commit/3ade8746ee66ad1394c9b5847a86fc326a942d06
  Author: Andrew Savonichev <andrew.savonichev at gmail.com>
  Date:   2025-09-12 (Fri, 12 Sep 2025)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaExpr.cpp
    M clang/test/SemaCXX/reinterpret-cast.cpp

  Log Message:
  -----------
  [clang] Look through parens around reinterpret_cast to emit a warning (#157033)

Clang warns about UB when a `reinterpret_cast` is dereferenced as an
incompatible type:
```
  long l;
  *reinterpret_cast<double*>(&l) // UB
```
However, the code was too strict and did not handle extra parens around
a `reinterpret_cast`, so the following case was not diagnosed:
```
  long l;
  *(reinterpret_cast<double*>(&l)) // UB, but no warning
```
The patch now skips ParenExpr when looking for a CXXReinterpretCastExpr
to enable a diagnostic for the second case.


  Commit: 1329af9c28582bd6b9d1e3e605f6243eb0e01683
      https://github.com/llvm/llvm-project/commit/1329af9c28582bd6b9d1e3e605f6243eb0e01683
  Author: Weibo He <NewSigma at 163.com>
  Date:   2025-09-12 (Fri, 12 Sep 2025)

  Changed paths:
    M llvm/include/llvm/Analysis/LoopInfo.h
    M llvm/include/llvm/Transforms/Utils/LoopUtils.h
    M llvm/lib/Analysis/LoopInfo.cpp
    M llvm/lib/Transforms/Scalar/LICM.cpp
    R llvm/test/Transforms/LICM/licm-coroutine.ll

  Log Message:
  -----------
  Revert "[LoopInfo] Pointer to stack object may not be loop invariant in a coroutine function (#149936)" (#157986)

Since #156788 has resolved #149604, we can revert this workaround now.


  Commit: 653ed062ea22e3d35b5b7ce6db391466821ca6e9
      https://github.com/llvm/llvm-project/commit/653ed062ea22e3d35b5b7ce6db391466821ca6e9
  Author: Aiden Grossman <aidengrossman at google.com>
  Date:   2025-09-11 (Thu, 11 Sep 2025)

  Changed paths:
    M clang/test/Modules/crash-vfs-umbrella-frameworks.m

  Log Message:
  -----------
  [Clang] Invoke shell script with bash

This test attempts to run a reproducer script generated by clang. This
is intended to be run by a shell, so invoke it with an actual shell.
This enables running the test with LLVM lit's internal shell.

Reviewers: bcardosolopes, ilovepi, petrhosek

Reviewed By: ilovepi

Pull Request: https://github.com/llvm/llvm-project/pull/157608


  Commit: 478b88d56386a1ae4d212bb1400cb5ca56c4c51e
      https://github.com/llvm/llvm-project/commit/478b88d56386a1ae4d212bb1400cb5ca56c4c51e
  Author: Aiden Grossman <aidengrossman at google.com>
  Date:   2025-09-12 (Fri, 12 Sep 2025)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaExpr.cpp
    M clang/test/SemaCXX/reinterpret-cast.cpp
    M llvm/include/llvm/Analysis/LoopInfo.h
    M llvm/include/llvm/Transforms/Utils/LoopUtils.h
    M llvm/lib/Analysis/LoopInfo.cpp
    M llvm/lib/Transforms/Scalar/LICM.cpp
    R llvm/test/Transforms/LICM/licm-coroutine.ll
    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:
  -----------
  [𝘀𝗽𝗿] changes introduced through rebase

Created using spr 1.3.6

[skip ci]


Compare: https://github.com/llvm/llvm-project/compare/3ff3710d1631...478b88d56386

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