[all-commits] [llvm/llvm-project] 795b4e: [MLIR] Add canonicalizations to all eligible `inde...

Nachi G via All-commits all-commits at lists.llvm.org
Mon Nov 4 13:24:43 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 795b4efad0259cbf03fc98e3045621916328ce57
      https://github.com/llvm/llvm-project/commit/795b4efad0259cbf03fc98e3045621916328ce57
  Author: Nachi G <nacgarg at users.noreply.github.com>
  Date:   2024-11-04 (Mon, 04 Nov 2024)

  Changed paths:
    M mlir/include/mlir/Dialect/Index/IR/IndexOps.td
    M mlir/lib/Dialect/Index/IR/IndexOps.cpp
    M mlir/test/Dialect/Index/index-canonicalize.mlir

  Log Message:
  -----------
  [MLIR] Add canonicalizations to all eligible `index` binary ops (#114000)

Generalizes the following canonicalization pattern to all associative
and commutative binary ops in the `index` dialect.

```
x = v + c1
y = x + c2
   -->
y = x + (c1 + c2)
```

This includes:
- `AddOp`
- `MulOp`
- `MaxSOp`
- `MaxUOp`
- `MinSOp`
- `MinUOp`
- `AndOp`
- `OrOp`
- `XOrOp`

The operation folding is implemented using the existing folders since
`createAndFold` is used in the canonicalization.



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