llvm-project/mlir/tools
Michal Terepeta 54c9984207 [mlir][Python] Fix generation of accessors for Optional
Previously, in case there was only one `Optional` operand/result within
the list, we would always return `None` from the accessor, e.g., for a
single optional result we would generate:

```
return self.operation.results[0] if len(self.operation.results) > 1 else None
```

But what we really want is to return `None` only if the length of
`results` is smaller than the total number of element groups (i.e.,
the optional operand/result is in fact missing).

This commit also renames a few local variables in the generator to make
the distinction between `isVariadic()` and `isVariableLength()` a bit
more clear.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D113855
2021-11-18 09:42:57 +01:00
..
mlir-cpu-runner [mlir][Standard] NFC - Drop remaining EDSC usage 2021-05-21 10:40:39 +00:00
mlir-linalg-ods-gen [mlir][NFC] Replace references to Identifier with StringAttr 2021-11-16 17:36:26 +00:00
mlir-lsp-server [mlir][Standard] NFC - Drop remaining EDSC usage 2021-05-21 10:40:39 +00:00
mlir-opt [mlir][X86Vector] Add specialized vector.transpose lowering patterns for AVX2 2021-11-11 07:33:31 +00:00
mlir-reduce [MLIR] Move TestDialect to ::test namespace 2021-08-14 13:24:41 -07:00
mlir-shlib [MLIR] Reapply: Adjust libMLIR building to more closely follow libClang 2020-05-04 20:47:57 -07:00
mlir-spirv-cpu-runner [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
mlir-tblgen [mlir][Python] Fix generation of accessors for Optional 2021-11-18 09:42:57 +01:00
mlir-translate Revert "[RFC] Factor out repetitive cmake patterns for llvm-style projects" 2020-10-04 15:17:34 -07:00
mlir-vulkan-runner [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
CMakeLists.txt [mlir][mlir-lsp] Add a new C++ LSP server for MLIR named mlir-lsp-server 2021-04-21 14:44:37 -07:00