llvm-project/mlir
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
..
cmake/modules Re-apply "[mlir] Allow out-of-tree python building from installed MLIR." 2021-11-14 20:31:34 -08:00
docs [MLIR][Docs] Fix link syntax in Rationale.md 2021-11-17 23:38:19 +00:00
examples [mlir][NFC] Replace references to Identifier with StringAttr 2021-11-16 17:36:26 +00:00
include [mlir][linalg][bufferize][NFC] Decouple ComprehensiveBufferize from tensor dialect 2021-11-18 16:11:24 +09:00
lib [mlir][linalg][bufferize] Fix bufferize bug where non-tensor ops are not skipped 2021-11-18 16:20:22 +09:00
python [mlir][Python] Fix generation of accessors for Optional 2021-11-18 09:42:57 +01:00
test [mlir][Python] Fix generation of accessors for Optional 2021-11-18 09:42:57 +01:00
tools [mlir][Python] Fix generation of accessors for Optional 2021-11-18 09:42:57 +01:00
unittests [mlir] Convert NamedAttribute to be a class 2021-11-18 05:39:29 +00:00
utils [mlir][NFC] Replace references to Identifier with StringAttr 2021-11-16 17:36:26 +00:00
.clang-format
.clang-tidy NFC: .clang-tidy: Inherit configs from parents to improve maintainability 2021-06-08 08:25:59 -07:00
CMakeLists.txt [mlir] Add MLIR-C dylib. 2021-11-11 22:58:13 -08:00
LICENSE.TXT
README.md

README.md

Multi-Level Intermediate Representation

See https://mlir.llvm.org/ for more information.