llvm-project/mlir/unittests/IR
Vladislav Vinogradov f3bf5c053b [mlir] Model MemRef memory space as Attribute
Based on the following discussion:
https://llvm.discourse.group/t/rfc-memref-memory-shape-as-attribute/2229

The goal of the change is to make memory space property to have more
expressive representation, rather then "magic" integer values.

It will allow to have more clean ASM form:

```
gpu.func @test(%arg0: memref<100xf32, "workgroup">)

// instead of

gpu.func @test(%arg0: memref<100xf32, 3>)
```

Explanation for `Attribute` choice instead of plain `string`:

* `Attribute` classes allow to use more type safe API based on RTTI.
* `Attribute` classes provides faster comparison operator based on
  pointer comparison in contrast to generic string comparison.
* `Attribute` allows to store more complex things, like structs or dictionaries.
  It will allows to have more complex memory space hierarchy.

This commit preserve old integer-based API and implements it on top
of the new one.

Depends on D97476

Reviewed By: rriddle, mehdi_amini

Differential Revision: https://reviews.llvm.org/D96145
2021-03-10 12:57:27 +03:00
..
AttributeTest.cpp [mlir] Simplify various pieces of code now that Identifier has access to the Context/Dialect 2021-02-26 18:00:05 -08:00
CMakeLists.txt [mlir] Add clone method to ShapedType 2021-02-15 11:04:16 -08:00
DialectTest.cpp [mlir] Support repeated delayed registration of dialect interfaces 2021-02-15 10:46:26 +01:00
OperationSupportTest.cpp [mlir][IR] Add an Operation::eraseOperands that supports batch erasure 2021-03-09 15:07:53 -08:00
ShapedTypeTest.cpp [mlir] Model MemRef memory space as Attribute 2021-03-10 12:57:27 +03:00