aboutsummaryrefslogtreecommitdiff
path: root/mlir/lib/Bindings/Python/IRModule.h
diff options
context:
space:
mode:
authorJacques Pienaar <jpienaar@google.com>2023-04-29 05:35:53 -0700
committerJacques Pienaar <jpienaar@google.com>2023-04-29 05:35:53 -0700
commit0610e2f6a2d42d83ff7a75729b3afa45d75729cc (patch)
tree6d6890e2a7144375f08f55b71be9ec1ebf69f1ab /mlir/lib/Bindings/Python/IRModule.h
parentcb133a4629a56f8c8a67fb7549356839917b52f9 (diff)
downloadllvm-0610e2f6a2d42d83ff7a75729b3afa45d75729cc.zip
llvm-0610e2f6a2d42d83ff7a75729b3afa45d75729cc.tar.gz
llvm-0610e2f6a2d42d83ff7a75729b3afa45d75729cc.tar.bz2
[mlir][bytecode] Allow client to specify a desired version.
Add method to set a desired bytecode file format to generate. Change write method to be able to return status including the minimum bytecode version needed by reader. This enables generating an older version of the bytecode (not dialect ops, attributes or types). But this does not guarantee that an older version can always be generated, e.g., if a dialect uses a new encoding only available at later bytecode version. This clamps setting to at most current version. Differential Revision: https://reviews.llvm.org/D146555
Diffstat (limited to 'mlir/lib/Bindings/Python/IRModule.h')
-rw-r--r--mlir/lib/Bindings/Python/IRModule.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/mlir/lib/Bindings/Python/IRModule.h b/mlir/lib/Bindings/Python/IRModule.h
index 920e6f4..56bb834 100644
--- a/mlir/lib/Bindings/Python/IRModule.h
+++ b/mlir/lib/Bindings/Python/IRModule.h
@@ -554,7 +554,9 @@ public:
bool assumeVerified);
// Implement the bound 'writeBytecode' method.
- void writeBytecode(const pybind11::object &fileObject);
+ MlirBytecodeWriterResult
+ writeBytecode(const pybind11::object &fileObject,
+ std::optional<int64_t> bytecodeVersion);
/// Moves the operation before or after the other operation.
void moveAfter(PyOperationBase &other);