[all-commits] [llvm/llvm-project] cef506: [mlir][linalg] Simplify `createWriteOrMaskedWrite`...

Andrzej Warzyล„ski via All-commits all-commits at lists.llvm.org
Sat Jun 7 13:07:48 PDT 2025


  Branch: refs/heads/users/banach-space/vector/update_create_write
  Home:   https://github.com/llvm/llvm-project
  Commit: cef5067c59fe0df19ec9e7fe0c46facccda05b7c
      https://github.com/llvm/llvm-project/commit/cef5067c59fe0df19ec9e7fe0c46facccda05b7c
  Author: Andrzej Warzynski <andrzej.warzynski at arm.com>
  Date:   2025-06-07 (Sat, 07 Jun 2025)

  Changed paths:
    M mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp

  Log Message:
  -----------
  [mlir][linalg] Simplify `createWriteOrMaskedWrite` (NFC)

This patch removes `inputVecSizesForLeadingDims` from the parameter list
of `createWriteOrMaskedWrite`. That argument is unnecessary โ€” vector sizes
can be obtained from the `vecToStore` parameter. Since this doesn't change
behavior or test results, it's marked as NFC.

Additional cleanups:
  * Renamed `vectorToStore` to `vecToStore` for consistency and brevity.
  * Rewrote a conditional at the end of the function to use early exit,
    improving readability:

```cpp
  // BEFORE:
  if (maskingRequried) {
    Value maskForWrite = ...;
    write = maskOperation(write, maskForWrite);
  }
  return write;

  // AFTER
  if (!maskingRequried)
    return write;

  Value maskFroWrite = ...;
  return vector::maskOperation(builder, write, maskForWrite);
```

This change addresses a TODO from #141244.



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