<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64076>64076</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[mlir] '-finalize-memref-to-llvm' pass failed with assertion error "attempting to construct a TypeRange with null types"
</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 585cbe3f
Reproduced with:
`mlir-opt -finalize-memref-to-llvm`
temp.mlir:
``` milr
module {
func.func @func1(%arg0: vector<23x23xi1>, %arg1: f32, %arg2: f32) {
%alloc = memref.alloc() : memref<14xf16, #spirv.storage_class<CrossWorkgroup>>
return
}
}
```
trace:
```console
<unknown>:0: error: conversion of memref memory space #spirv.storage_class<CrossWorkgroup> to integer address space failed. Consider adding memory space conversions.
Assertion failed: (llvm::all_of(types, [](Type t) { return t; }) && "attempting to construct a TypeRange with null types"), function TypeRange, file TypeRange.cpp, line 20.
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 -finalize-memref-to-llvm temp.mlir
#0 0x0000000104838a90 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/workspace/mlir-fuzz/build/bin/mlir-opt+0x1002f8a90)
#1 0x0000000104836d2c llvm::sys::RunSignalHandlers() (/workspace/mlir-fuzz/build/bin/mlir-opt+0x1002f6d2c)
#2 0x000000010483913c SignalHandler(int) (/workspace/mlir-fuzz/build/bin/mlir-opt+0x1002f913c)
#3 0x00000001be7894c4 (/usr/lib/system/libsystem_platform.dylib+0x1803414c4)
#4 0x00000001be771ee0 (/usr/lib/system/libsystem_pthread.dylib+0x180329ee0)
#5 0x00000001be6ac340 (/usr/lib/system/libsystem_c.dylib+0x180264340)
#6 0x00000001be6ab754 (/usr/lib/system/libsystem_c.dylib+0x180263754)
#7 0x0000000108e38e70 mlir::TypeRange::TypeRange(llvm::ArrayRef<mlir::Type>) (.cold.2) (/workspace/mlir-fuzz/build/bin/mlir-opt+0x1048f8e70)
#8 0x0000000106fff508 mlir::TypeRange::TypeRange(mlir::OperandRange) (/workspace/mlir-fuzz/build/bin/mlir-opt+0x102abf508)
#9 0x0000000106fe1a00 mlir::Operation::create(mlir::OperationState const&) (/workspace/mlir-fuzz/build/bin/mlir-opt+0x102aa1a00)
#10 0x0000000106f33e28 mlir::OpBuilder::create(mlir::OperationState const&) (/workspace/mlir-fuzz/build/bin/mlir-opt+0x1029f3e28)
#11 0x0000000106700a18 mlir::LLVM::UndefOp mlir::OpBuilder::create<mlir::LLVM::UndefOp, mlir::Type&>(mlir::Location, mlir::Type&) (/workspace/mlir-fuzz/build/bin/mlir-opt+0x1021c0a18)
#12 0x0000000106789330 mlir::MemRefDescriptor::undef(mlir::OpBuilder&, mlir::Location, mlir::Type) (/workspace/mlir-fuzz/build/bin/mlir-opt+0x102249330)
#13 0x000000010678d990 mlir::ConvertToLLVMPattern::createMemRefDescriptor(mlir::Location, mlir::MemRefType, mlir::Value, mlir::Value, llvm::ArrayRef<mlir::Value>, llvm::ArrayRef<mlir::Value>, mlir::ConversionPatternRewriter&) const (/workspace/mlir-fuzz/build/bin/mlir-opt+0x10224d990)
#14 0x00000001067e3ae0 mlir::AllocLikeOpLLVMLowering::matchAndRewrite(mlir::Operation*, llvm::ArrayRef<mlir::Value>, mlir::ConversionPatternRewriter&) const (/workspace/mlir-fuzz/build/bin/mlir-opt+0x1022a3ae0)
#15 0x0000000106eccbc4 mlir::ConversionPattern::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&) const (/workspace/mlir-fuzz/build/bin/mlir-opt+0x10298cbc4)
#16 0x00000001084baf14 mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref<bool (mlir::Pattern const&)>, llvm::function_ref<void (mlir::Pattern const&)>, llvm::function_ref<mlir::LogicalResult (mlir::Pattern const&)>)::$_2::operator()() const (/workspace/mlir-fuzz/build/bin/mlir-opt+0x103f7af14)
#17 0x00000001084b8210 mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref<bool (mlir::Pattern const&)>, llvm::function_ref<void (mlir::Pattern const&)>, llvm::function_ref<mlir::LogicalResult (mlir::Pattern const&)>) (/workspace/mlir-fuzz/build/bin/mlir-opt+0x103f78210)
#18 0x0000000106ed88b0 (anonymous namespace)::OperationLegalizer::legalize(mlir::Operation*, mlir::ConversionPatternRewriter&) (/workspace/mlir-fuzz/build/bin/mlir-opt+0x1029988b0)
#19 0x0000000106ed0db0 (anonymous namespace)::OperationConverter::convertOperations(llvm::ArrayRef<mlir::Operation*>, llvm::function_ref<void (mlir::Diagnostic&)>) (/workspace/mlir-fuzz/build/bin/mlir-opt+0x102990db0)
#20 0x0000000106ed2ef8 mlir::applyPartialConversion(mlir::Operation*, mlir::ConversionTarget&, mlir::FrozenRewritePatternSet const&, llvm::DenseSet<mlir::Operation*, llvm::DenseMapInfo<mlir::Operation*, void>>*) (/workspace/mlir-fuzz/build/bin/mlir-opt+0x102992ef8)
#21 0x00000001067e7988 (anonymous namespace)::FinalizeMemRefToLLVMConversionPass::runOnOperation() (/workspace/mlir-fuzz/build/bin/mlir-opt+0x1022a7988)
#22 0x0000000106e87efc mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/workspace/mlir-fuzz/build/bin/mlir-opt+0x102947efc)
#23 0x0000000106e885ec mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/workspace/mlir-fuzz/build/bin/mlir-opt+0x1029485ec)
#24 0x0000000106e8a480 mlir::PassManager::run(mlir::Operation*) (/workspace/mlir-fuzz/build/bin/mlir-opt+0x10294a480)
#25 0x0000000106e82968 performActions(llvm::raw_ostream&, std::__1::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) (/workspace/mlir-fuzz/build/bin/mlir-opt+0x102942968)
#26 0x0000000106e81fbc 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/mlir-fuzz/build/bin/mlir-opt+0x102941fbc)
#27 0x0000000106efffa0 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/mlir-fuzz/build/bin/mlir-opt+0x1029bffa0)
#28 0x0000000106e7c970 mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/workspace/mlir-fuzz/build/bin/mlir-opt+0x10293c970)
#29 0x0000000106e7cde0 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/workspace/mlir-fuzz/build/bin/mlir-opt+0x10293cde0)
#30 0x0000000104543088 main (/workspace/mlir-fuzz/build/bin/mlir-opt+0x100003088)
#31 0x000000010ff6d088
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWl9P4zz2_jThxqJ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