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
15 lines
537 B
MLIR
15 lines
537 B
MLIR
// This file contains test cases related to roundtripping.
|
|
|
|
// Bytecode currently does not support big-endian platforms
|
|
// UNSUPPORTED: target=s390x-{{.*}}
|
|
|
|
//===--------------------------------------------------------------------===//
|
|
// Test roundtrip
|
|
//===--------------------------------------------------------------------===//
|
|
|
|
// RUN: mlir-opt %S/versioned-op-1.12.mlirbc -emit-bytecode \
|
|
// RUN: -emit-bytecode-version=0 | mlir-opt -o %t.1 && \
|
|
// RUN: mlir-opt %S/versioned-op-1.12.mlirbc -o %t.2 && \
|
|
// RUN: diff %t.1 %t.2
|
|
|