llvm-project/mlir/unittests
River Riddle ae40d62541 [mlir] Refactor ElementsAttr's value access API
There are several aspects of the API that either aren't easy to use, or are
deceptively easy to do the wrong thing. The main change of this commit
is to remove all of the `getValue<T>`/`getFlatValue<T>` from ElementsAttr
and instead provide operator[] methods on the ranges returned by
`getValues<T>`. This provides a much more convenient API for the value
ranges. It also removes the easy-to-be-inefficient nature of
getValue/getFlatValue, which under the hood would construct a new range for
the type `T`. Constructing a range is not necessarily cheap in all cases, and
could lead to very poor performance if used within a loop; i.e. if you were to
naively write something like:

```
DenseElementsAttr attr = ...;
for (int i = 0; i < size; ++i) {
  // We are internally rebuilding the APFloat value range on each iteration!!
  APFloat it = attr.getFlatValue<APFloat>(i);
}
```

Differential Revision: https://reviews.llvm.org/D113229
2021-11-09 00:15:08 +00:00
..
Analysis [MLIR] Add functionality to remove redundant local variables 2021-09-25 16:10:43 +05:30
Dialect [mlir] Refactor ElementsAttr's value access API 2021-11-09 00:15:08 +00:00
ExecutionEngine [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
IR [mlir] Refactor ElementsAttr's value access API 2021-11-09 00:15:08 +00:00
Interfaces [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
Pass Add a clear() method on the PassManager (NFC) 2021-10-25 04:39:00 +00:00
Rewrite Fix memory leaks in MLIR unit-tests (NFC) 2021-10-02 21:31:46 +00:00
Support [mlir] fix Debug unittests 2021-11-03 21:34:36 +00:00
TableGen Fix memory leaks in mlir/unittests/MLIRTableGenTests 2021-10-02 21:06:02 +00:00
Transforms [mlir] Make ConversionTarget dynamic legality callbacks composable 2021-10-12 13:05:54 +03:00
CMakeLists.txt [mlir] Make ConversionTarget dynamic legality callbacks composable 2021-10-12 13:05:54 +03:00