-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mlir][spirv] Change the return type for {Min|Max}VersionBase
For synthesizing an op's implementation of the generated interface from {Min|Max}Version, we need to define an `initializer` and `mergeAction`. The `initializer` specifies the initial version, and `mergeAction` specifies how version specifications from different parts of the op should be merged to generate a final version requirements. Previously we use the specified version enum as the type for both the initializer and thus the final return type. This means we need to perform `static_cast` over some hopefully not used number (`~0u`) as the initializer. This is quite opaque and sort of not guaranteed to work. Also, there are ops that have an enum attribute where some values declare version requirements (e.g., enumerant `B` requires v1.1+) but some not (e.g., enumerant `A` requires nothing). Then a concrete op instance with `A` will still declare it implements the version interface (because interface implementation is static for an op) but actually theirs no requirements for version. So this commit changes to use an more explicit `llvm::Optional` to wrap around the returned version enum. This should make it more clear. Reviewed By: jpienaar Differential Revision: https://reviews.llvm.org/D108312
- Loading branch information
1 parent
68e2231
commit cb395f6
Showing
6 changed files
with
58 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters