[all-commits] [llvm/llvm-project] 1f5807: [mlir][vector][nfc] Simplify `in_bounds` attr upda...

Andrzej Warzyński via All-commits all-commits at lists.llvm.org
Wed Jul 24 06:40:41 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1f5807eb359fb172575e18bb063fd85e4dc836e9
      https://github.com/llvm/llvm-project/commit/1f5807eb359fb172575e18bb063fd85e4dc836e9
  Author: Andrzej Warzyński <andrzej.warzynski at arm.com>
  Date:   2024-07-24 (Wed, 24 Jul 2024)

  Changed paths:
    M mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp

  Log Message:
  -----------
  [mlir][vector][nfc] Simplify `in_bounds` attr update (#100334)

Since the `in_bounds` attribute is mandatory, there's no need for logic
like this (`readOp.getInBounds()` is guaranteed to return a non-empty
ArrayRef):

```cpp
ArrayAttr inBoundsAttr = readOp.getInBounds()
    ? rewriter.getArrayAttr( readOp.getInBoundsAttr().getValue().drop_back(dimsToDrop))
    : ArrayAttr();
```

Instead, we can do this:
```cpp
ArrayAttr inBoundsAttr = rewriter.getArrayAttr(
    readOp.getInBoundsAttr().getValue().drop_back(dimsToDrop));
```

This is a small follow-up for #97049 - this change should've been
included there.



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