diff options
Diffstat (limited to 'mlir/lib/Bytecode/Writer/IRNumbering.cpp')
| -rw-r--r-- | mlir/lib/Bytecode/Writer/IRNumbering.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/mlir/lib/Bytecode/Writer/IRNumbering.cpp b/mlir/lib/Bytecode/Writer/IRNumbering.cpp index a306010698f2..f36c9ef060b6 100644 --- a/mlir/lib/Bytecode/Writer/IRNumbering.cpp +++ b/mlir/lib/Bytecode/Writer/IRNumbering.cpp @@ -9,6 +9,7 @@ #include "IRNumbering.h" #include "mlir/Bytecode/BytecodeImplementation.h" #include "mlir/Bytecode/BytecodeOpInterface.h" +#include "mlir/Bytecode/Encoding.h" #include "mlir/IR/AsmState.h" #include "mlir/IR/BuiltinTypes.h" #include "mlir/IR/OpDefinition.h" @@ -425,17 +426,20 @@ void IRNumberingState::number(Operation &op) { // Only number the operation's dictionary if it isn't empty. DictionaryAttr dictAttr = op.getDiscardableAttrDictionary(); - // Prior to version 5, or when properties are not used, we need to number also - // the merged dictionary containing both the inherent and discardable - // attribute. - if (config.getDesiredBytecodeVersion() < 5 || !op.getPropertiesStorage()) + // Prior to a version with native property encoding, or when properties are + // not used, we need to number also the merged dictionary containing both the + // inherent and discardable attribute. + if (config.getDesiredBytecodeVersion() < + bytecode::kNativePropertiesEncoding || + !op.getPropertiesStorage()) { dictAttr = op.getAttrDictionary(); + } if (!dictAttr.empty()) number(dictAttr); // Visit the operation properties (if any) to make sure referenced attributes // are numbered. - if (config.getDesiredBytecodeVersion() >= 5 && + if (config.getDesiredBytecodeVersion() >= bytecode::kNativePropertiesEncoding && op.getPropertiesStorageSize()) { if (op.isRegistered()) { // Operation that have properties *must* implement this interface. |
