|
Revision tags: llvmorg-20.1.0, llvmorg-20.1.0-rc3, llvmorg-20.1.0-rc2, llvmorg-20.1.0-rc1, llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init |
|
| #
c8598fa2 |
| 19-Jul-2022 |
Jacques Pienaar <[email protected]> |
[mlir] Add refineReturnTypes to InferTypeOpInterface
refineReturnType method shares the same parameters as inferReturnTypes but gets passed in the return types of the op if known that can be used du
[mlir] Add refineReturnTypes to InferTypeOpInterface
refineReturnType method shares the same parameters as inferReturnTypes but gets passed in the return types of the op if known that can be used during refinement passes or for more op specific error reporting. Currently the error reporting on failure is generic and doesn't allow for specializing the returned result based on failure, with this change what would previously have been a separate trait with specialized verification can just be handled as part of inferrence rather than duplicated.
refineReturnTypes behaves like inferReturnTypes if no result types are fed in, while the current verification is recast as the default implementation for refineReturnTypes with it calling inferReturnTypes (and so the default type verification now goes through refine and allows for more op specific inference mismatch errors).
Differential Revision: https://reviews.llvm.org/D129955
show more ...
|
| #
c27d8152 |
| 14-Jul-2022 |
Kazu Hirata <[email protected]> |
[mlir] Use value instead of getValue (NFC)
|
| #
491d2701 |
| 13-Jul-2022 |
Kazu Hirata <[email protected]> |
[mlir] Use has_value instead of hasValue (NFC)
|
|
Revision tags: llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4 |
|
| #
d4102861 |
| 21-May-2022 |
Min-Yih Hsu <[email protected]> |
[mlir] Prevent SubElementInterface from going into infinite recursion
Since only mutable types and attributes can go into infinite recursion inside SubElementInterface::walkSubElement, and there are
[mlir] Prevent SubElementInterface from going into infinite recursion
Since only mutable types and attributes can go into infinite recursion inside SubElementInterface::walkSubElement, and there are only a few of them (mutable types and attributes), we introduce new traits for Type and Attribute: TypeTrait::IsMutable and AttributeTrait::IsMutable, respectively. They indicate whether a type or attribute is mutable. Such traits are required if the ImplType defines a `mutate` function.
Then, inside SubElementInterface, we use a set to record visited mutable types and attributes that have been visited before.
Differential Revision: https://reviews.llvm.org/D127537
show more ...
|
| #
ea488bd6 |
| 28-Jun-2022 |
River Riddle <[email protected]> |
[mlir] Allow for attaching external resources to .mlir files
This commit enables support for providing and processing external resources within MLIR assembly formats. This is a mechanism with which
[mlir] Allow for attaching external resources to .mlir files
This commit enables support for providing and processing external resources within MLIR assembly formats. This is a mechanism with which dialects, and external clients, may attach additional information when printing IR without that information being encoded in the IR itself. External resources are not uniqued within the MLIR context, are not attached directly to any operation, and are solely intended to live and be processed outside of the immediate IR. There are many potential uses of this functionality, for example MLIR's pass crash reproducer could utilize this to attach the pass resource executing when a crash occurs. Other types of uses may be embedding large amounts of binary data, such as weights in ML applications, that shouldn't be copied directly into the MLIR context, but need to be kept adjacent to the IR.
External resources are encoded using a key-value pair nested within a dictionary anchored by name either on a dialect, or an externally registered entity. The key is an identifier used to disambiguate the data. The value may be stored in various limited forms, but general encodings use a string (human readable) or blob format (binary). Within the textual format, an example may be of the form:
```mlir {-# // The `dialect_resources` section within the file-level metadata // dictionary is used to contain any dialect resource entries. dialect_resources: { // Here is a dictionary anchored on "foo_dialect", which is a dialect // namespace. foo_dialect: { // `some_dialect_resource` is a key to be interpreted by the dialect, // and used to initialize/configure/etc. some_dialect_resource: "Some important resource value" } }, // The `external_resources` section within the file-level metadata // dictionary is used to contain any non-dialect resource entries. external_resources: { // Here is a dictionary anchored on "mlir_reproducer", which is an // external entity representing MLIR's crash reproducer functionality. mlir_reproducer: { // `pipeline` is an entry that holds a crash reproducer pipeline // resource. pipeline: "func.func(canonicalize,cse)" } } ```
Differential Revision: https://reviews.llvm.org/D126446
show more ...
|
| #
3b7c3a65 |
| 25-Jun-2022 |
Kazu Hirata <[email protected]> |
Revert "Don't use Optional::hasValue (NFC)"
This reverts commit aa8feeefd3ac6c78ee8f67bf033976fc7d68bc6d.
|
| #
aa8feeef |
| 25-Jun-2022 |
Kazu Hirata <[email protected]> |
Don't use Optional::hasValue (NFC)
|
| #
064a08cd |
| 21-Jun-2022 |
Kazu Hirata <[email protected]> |
Don't use Optional::hasValue (NFC)
|
| #
d883a02a |
| 21-Jun-2022 |
Mogball <[email protected]> |
[mlir][ods] Remove StructAttr
Depends on D127373
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D127375
|
| #
30c67587 |
| 19-Jun-2022 |
Kazu Hirata <[email protected]> |
Use value_or instead of getValueOr (NFC)
|
| #
537f2208 |
| 13-Jun-2022 |
Mogball <[email protected]> |
[mlir] Support getSuccessorInputs from parent op
Ops that implement `RegionBranchOpInterface` are allowed to indicate that they can branch back to themselves in `getSuccessorRegions`, but there is n
[mlir] Support getSuccessorInputs from parent op
Ops that implement `RegionBranchOpInterface` are allowed to indicate that they can branch back to themselves in `getSuccessorRegions`, but there is no API that allows them to specify the forwarded operands. This patch enables that by changing `getSuccessorEntryOperands` to accept `None`.
Fixes #54928
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D127239
show more ...
|
| #
95aff23e |
| 02-Jun-2022 |
Krzysztof Drewniak <[email protected]> |
Re-land "[mlir] Add integer range inference analysis""
This reverts commit 4e5ce2056e3e85f109a074e80bdd23a10ca2bed9.
This relands commit 1350c9887dca5ba80af8e3c1e61b29d6696eb240.
Reinstates the ra
Re-land "[mlir] Add integer range inference analysis""
This reverts commit 4e5ce2056e3e85f109a074e80bdd23a10ca2bed9.
This relands commit 1350c9887dca5ba80af8e3c1e61b29d6696eb240.
Reinstates the range analysis with the build issue fixed.
Differential Revision: https://reviews.llvm.org/D126926
show more ...
|
| #
4e5ce205 |
| 02-Jun-2022 |
Mehdi Amini <[email protected]> |
Revert "[mlir] Add integer range inference analysis"
This reverts commit 1350c9887dca5ba80af8e3c1e61b29d6696eb240.
Shared library build is broken with undefined references.
|
| #
1350c988 |
| 02-Jun-2022 |
Krzysztof Drewniak <[email protected]> |
[mlir] Add integer range inference analysis
This commit defines a dataflow analysis for integer ranges, which uses a newly-added InferIntRangeInterface to compute the lower and upper bounds on the r
[mlir] Add integer range inference analysis
This commit defines a dataflow analysis for integer ranges, which uses a newly-added InferIntRangeInterface to compute the lower and upper bounds on the results of an operation from the bounds on the arguments. The range inference is a flow-insensitive dataflow analysis that can be used to simplify code, such as by statically identifying bounds checks that cannot fail in order to eliminate them.
The InferIntRangeInterface has one method, inferResultRanges(), which takes a vector of inferred ranges for each argument to an op implementing the interface and a callback allowing the implementation to define the ranges for each result. These ranges are stored as ConstantIntRanges, which hold the lower and upper bounds for a value. Bounds are tracked separately for the signed and unsigned interpretations of a value, which ensures that the impact of arithmetic overflows is correctly tracked during the analysis.
The commit also adds a -test-int-range-inference pass to test the analysis until it is integrated into SCCP or otherwise exposed.
Finally, this commit fixes some bugs relating to the handling of region iteration arguments and terminators in the data flow analysis framework.
Depends on D124020
Depends on D124021
Reviewed By: rriddle, Mogball
Differential Revision: https://reviews.llvm.org/D124023
show more ...
|
| #
122e6858 |
| 19-May-2022 |
Alex Zinenko <[email protected]> |
[mlir] do not elide dialect prefix for ops with dots in the name
For the hypothetical "a.b.c" op printed within a region that declares "a" as the default dialect, MLIR would currently elide the "a."
[mlir] do not elide dialect prefix for ops with dots in the name
For the hypothetical "a.b.c" op printed within a region that declares "a" as the default dialect, MLIR would currently elide the "a." prefix and only print "b.c". However, this becomes ambiguous while parsing as "b.c" may be exist as the "c" op in the "b" dialect. If it does not, the parsing currently fails. Do not elide the default dialect if the op name contains further dots to avoid the ambiguity.
See https://discourse.llvm.org/t/dropping-dialect-prefix-for-ops-with-multiple-dots-in-the-name/62562
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D125975
show more ...
|
| #
19906262 |
| 12-May-2022 |
Mogball <[email protected]> |
[mlir] (NFC) Use assembly format for test.graph_region
|
| #
d85eb4e2 |
| 29-Apr-2022 |
Chris Lattner <[email protected]> |
[AsmParser] Introduce a new "Argument" abstraction + supporting logic
MLIR has a common pattern for "arguments" that uses syntax like `%x : i32 {attrs} loc("sourceloc")` which is implemented in adho
[AsmParser] Introduce a new "Argument" abstraction + supporting logic
MLIR has a common pattern for "arguments" that uses syntax like `%x : i32 {attrs} loc("sourceloc")` which is implemented in adhoc ways throughout the codebase. The approach this uses is verbose (because it is implemented with parallel arrays) and inconsistent (e.g. lots of things drop source location info).
Solve this by introducing OpAsmParser::Argument and make addRegion (which sets up BlockArguments for the region) take it. Convert the world to propagating this down. This means that we correctly capture and propagate source location information in a lot more cases (e.g. see the affine.for testcase example), and it also simplifies much code.
Differential Revision: https://reviews.llvm.org/D124649
show more ...
|
|
Revision tags: llvmorg-14.0.3 |
|
| #
5dedf911 |
| 26-Apr-2022 |
Chris Lattner <[email protected]> |
[AsmParser] Rework logic around "region argument parsing"
The asm parser had a notional distinction between parsing an operand (like "%foo" or "%4#3") and parsing a region argument (which isn't supp
[AsmParser] Rework logic around "region argument parsing"
The asm parser had a notional distinction between parsing an operand (like "%foo" or "%4#3") and parsing a region argument (which isn't supposed to allow a result number like #3).
Unfortunately the implementation has two problems:
1) It didn't actually check for the result number and reject it. parseRegionArgument and parseOperand were identical. 2) It had a lot of machinery built up around it that paralleled operand parsing. This also was functionally identical, but also had some subtle differences (e.g. the parseOptional stuff had a different result type).
I thought about just removing all of this, but decided that the missing error checking was important, so I reimplemented it with a `allowResultNumber` flag on parseOperand. This keeps the codepaths unified and adds the missing error checks.
Differential Revision: https://reviews.llvm.org/D124470
show more ...
|
| #
9e0b5533 |
| 27-Apr-2022 |
Mathieu Fehr <[email protected]> |
[mlir] Add extensible dialects
Depends on D104534 Add support for extensible dialects, which are dialects that can be extended at runtime with new operations and types.
These operations and types c
[mlir] Add extensible dialects
Depends on D104534 Add support for extensible dialects, which are dialects that can be extended at runtime with new operations and types.
These operations and types cannot at the moment implement traits or interfaces.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D104554
show more ...
|
|
Revision tags: llvmorg-14.0.2 |
|
| #
a266a210 |
| 25-Apr-2022 |
Jeremy Furtek <[email protected]> |
[mlir][ods] Extend the EnumAttr tablegen class to support BitEnum attributes
This diff allows the EnumAttr class to be used for bit enum attributes (in addition to previously supported integer enum
[mlir][ods] Extend the EnumAttr tablegen class to support BitEnum attributes
This diff allows the EnumAttr class to be used for bit enum attributes (in addition to previously supported integer enum attributes). While integer and bit enum attributes share many common implementation aspects, parsing bit enum values requires a separate implementation. This is accomplished by creating empty parser and printer strings in the EnumAttrInfo record, and having derived classes (specific to bit and integer enums) override with an appropriate parser/printer string.
To support existing bit enums that may use a vertical bar separator, the parser is modified to support the | token.
Tests were added for bit enums alongside integer enums.
Future diffs for fastmath attributes in the arithmetic dialect will use these changes.
(resubmission of earlier abaondoned diff, updated to reflect subsequent changes in the repository)
Reviewed By: Mogball
Differential Revision: https://reviews.llvm.org/D123880
show more ...
|
| #
3e8560f8 |
| 22-Apr-2022 |
cpillmayer <[email protected]> |
[MLIR] Add option to print users of an operation as comment in the printer
This allows printing the users of an operation as proposed in the git issue #53286. To be able to refer to operations with
[MLIR] Add option to print users of an operation as comment in the printer
This allows printing the users of an operation as proposed in the git issue #53286. To be able to refer to operations with no result, these operations are assigned an ID in SSANameState.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D124048
show more ...
|
| #
31c8abc3 |
| 21-Apr-2022 |
Chris Lattner <[email protected]> |
[AsmParser/Printer] Rework sourceloc support for function arguments.
When Location tracking support for block arguments was added, we discussed various approaches to threading support for this throu
[AsmParser/Printer] Rework sourceloc support for function arguments.
When Location tracking support for block arguments was added, we discussed various approaches to threading support for this through function-like argument parsing. At the time, we added a parallel array of locations that could hold this. It turns out that that approach was verbose and error prone, roughly no one adopted it.
This patch takes a different approach, adding an optional source locator to the UnresolvedOperand class. This fits much more naturally into the standard structure we use for representing locators, and gives all the function like dialects locator support for free (e.g. see the test adding an example for the LLVM dialect).
Differential Revision: https://reviews.llvm.org/D124188
show more ...
|
| #
5232c5c5 |
| 15-Apr-2022 |
Chia-hung Duan <[email protected]> |
[mlir] Fix verification order of nested ops.
In order to increase parallism, certain ops with regions and have the IsIsolatedFromAbove trait will have their verification delayed. That means the regi
[mlir] Fix verification order of nested ops.
In order to increase parallism, certain ops with regions and have the IsIsolatedFromAbove trait will have their verification delayed. That means the region verifier may access the invalid ops and may lead to a crash.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D122771
show more ...
|
|
Revision tags: llvmorg-14.0.1 |
|
| #
0c789db5 |
| 08-Apr-2022 |
Markus Böck <[email protected]> |
[mlir] Add support for operation-produced successor arguments in BranchOpInterface
This patch revamps the BranchOpInterface a bit and allows a proper implementation of what was previously `getMutabl
[mlir] Add support for operation-produced successor arguments in BranchOpInterface
This patch revamps the BranchOpInterface a bit and allows a proper implementation of what was previously `getMutableSuccessorOperands` for operations, which internally produce arguments to some of the block arguments. A motivating example for this would be an invoke op with a error handling path: ``` invoke %function(%0) label ^success ^error(%1 : i32)
^error(%e: !error, %arg0 : i32): ... ``` The advantages of this are that any users of `BranchOpInterface` can still argue over remaining block argument operands (such as `%1` in the example above), as well as make use of the modifying capabilities to add more operands, erase an operand etc.
The way this patch implements that functionality is via a new class called `SuccessorOperands`, which is now returned by `getSuccessorOperands`. It basically contains an `unsigned` denoting how many operator produced operands exist, as well as a `MutableOperandRange`, which are the usual forwarded operands we are used to. The produced operands are assumed to the first few block arguments, followed by the forwarded operands afterwards. The role of `SuccessorOperands` is to provide various utility functions to modify and query the successor arguments from a `BranchOpInterface`.
Differential Revision: https://reviews.llvm.org/D123062
show more ...
|
| #
5e50dd04 |
| 31-Mar-2022 |
River Riddle <[email protected]> |
[mlir] Rework the implementation of TypeID
This commit restructures how TypeID is implemented to ideally avoid the current problems related to shared libraries. This is done by changing the "implici
[mlir] Rework the implementation of TypeID
This commit restructures how TypeID is implemented to ideally avoid the current problems related to shared libraries. This is done by changing the "implicit" fallback path to use the name of the type, instead of using a static template variable (which breaks shared libraries). The major downside to this is that it adds some additional initialization costs for the implicit path. Given the use of type names for uniqueness in the fallback, we also no longer allow types defined in anonymous namespaces to have an implicit TypeID. To simplify defining an ID for these classes, a new `MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID` macro was added to allow for explicitly defining a TypeID directly on an internal class.
To help identify when types are using the fallback, `-debug-only=typeid` can be used to log which types are using implicit ids.
This change generally only requires changes to the test passes, which are all defined in anonymous namespaces, and thus can't use the fallback any longer.
Differential Revision: https://reviews.llvm.org/D122775
show more ...
|