<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64265>64265</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[mlir] `emit-bytecode` Pass crashed with assertion failure "attribute not numbered"
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Colloportus0
</td>
</tr>
</table>
<pre>
MLIR built at commit b4c54b20
Reproduced with:
`mlir-opt --emit-bytecode temp.mlir`
temp.mlir:
``` milr
%c26 = arith.constant 26 : index
%alloc_23 = memref.alloc() : memref<16x10xi1>
```
trace:
```console
Assertion failed: (attrs.count(attr) && "attribute not numbered"), function getNumber, file IRNumbering.h, line 165.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: mlir-opt --emit-bytecode temp.mlir
#0 0x00000001005dc548 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/workspace/build/bin/mlir-opt+0x1002f8548)
#1 0x00000001005da7e4 llvm::sys::RunSignalHandlers() (/workspace/build/bin/mlir-opt+0x1002f67e4)
#2 0x00000001005dcbf4 SignalHandler(int) (/workspace/build/bin/mlir-opt+0x1002f8bf4)
#3 0x00000001a46cd4c4 (/usr/lib/system/libsystem_platform.dylib+0x1803414c4)
#4 0x00000001a46b5ee0 (/usr/lib/system/libsystem_pthread.dylib+0x180329ee0)
#5 0x00000001a45f0340 (/usr/lib/system/libsystem_c.dylib+0x180264340)
#6 0x00000001a45ef754 (/usr/lib/system/libsystem_c.dylib+0x180263754)
#7 0x00000001050ae0d0 mlir::bytecode::detail::IRNumberingState::getNumber(mlir::Attribute) (.cold.2) (/workspace/build/bin/mlir-opt+0x104dca0d0)
#8 0x00000001042bc19c mlir::bytecode::detail::IRNumberingState::getNumber(mlir::Attribute) (/workspace/build/bin/mlir-opt+0x103fd819c)
#9 0x00000001042bb034 (anonymous namespace)::DialectWriter::writeAttribute(mlir::Attribute) (/workspace/build/bin/mlir-opt+0x103fd7034)
#10 0x0000000101671bc0 mlir::detail::BytecodeOpInterfaceInterfaceTraits::Model<mlir::memref::AllocOp>::writeProperties(mlir::detail::BytecodeOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::DialectBytecodeWriter&) (/workspace/build/bin/mlir-opt+0x10138dbc0)
#11 0x00000001042bdf48 (anonymous namespace)::BytecodeWriter::writeOp((anonymous namespace)::EncodingEmitter&, mlir::Operation*) (/workspace/build/bin/mlir-opt+0x103fd9f48)
#12 0x00000001042c33d4 (anonymous namespace)::BytecodeWriter::writeRegion((anonymous namespace)::EncodingEmitter&, mlir::Region*) (/workspace/build/bin/mlir-opt+0x103fdf3d4)
#13 0x00000001042bebb0 (anonymous namespace)::BytecodeWriter::writeOp((anonymous namespace)::EncodingEmitter&, mlir::Operation*) (/workspace/build/bin/mlir-opt+0x103fdabb0)
#14 0x00000001042b909c mlir::writeBytecodeToFile(mlir::Operation*, llvm::raw_ostream&, mlir::BytecodeWriterConfig const&) (/workspace/build/bin/mlir-opt+0x103fd509c)
#15 0x0000000102c608b4 performActions(llvm::raw_ostream&, std::__1::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) (/workspace/build/bin/mlir-opt+0x10297c8b4)
#16 0x0000000102c5fd30 mlir::LogicalResult llvm::function_ref<mlir::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::$_1>(long, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) (/workspace/build/bin/mlir-opt+0x10297bd30)
#17 0x0000000102cdebe0 mlir::splitAndProcessBuffer(std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, bool, bool) (/workspace/build/bin/mlir-opt+0x1029fabe0)
#18 0x0000000102c5a6e4 mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/workspace/build/bin/mlir-opt+0x1029766e4)
#19 0x0000000102c5ab54 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/workspace/build/bin/mlir-opt+0x102976b54)
#20 0x00000001002e758c main (/workspace/build/bin/mlir-opt+0x10000358c)
#21 0x000000010b8f1088
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzcWN9v4y4S_2vIC2qEwXbshzxk00a30vZatSvdY4VhnHCLwQf42v73J-yksdNv2232fn13tWpsMDOfz8wwA8O9V1sDsETZF5RdzngXdtYt11Zr21oXOk9mlZXPy-tvX-9w1SkdMA9Y2KZRAeMqFVlaUYLIJSKrO2idlZ0AiR9V2CG2wniYQTlptHIXtg344gIaFS6q5wDCSsABmnYeZ1G-lzP8PY6z1YuU4T9ulHYH0TQTNMeIXWLuVNjNhTU-cBNwP7rCykh4evmWa23FA2X9ggYaB_W8H0O0QLTsVwzDiK2T_CkhTypB7AqfQBhe96PBcQGvYUYkVsMwuvIeXFDW4JorDTIqQrTgITg_F7YzYf_Wo6A5ivApjSOq6gJgYwM2XVOBA4koRbREdI3rzohe6hbCX_vZflRpwF_vhgFltvNdHNXKAE7ybD4guv12tbq_wr6roi85rrotdhC9joPFuxBaHznRDaKbrQq7rpoL2yC60fqfh5-L1tm_gwiIbpT3HXhEN5gbiZURuove3QEWjvs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