Issue |
128277
|
Summary |
[mlir] Crash when using --affine-super-vectorize="virtual-vector-size=128"
|
Labels |
mlir
|
Assignees |
|
Reporter |
wangyongj1a
|
I have the following MLIR program:
test.mlir:
```
module {
func.func @func1() {
%idx0 = index.constant 0
%alloc_82 = memref.alloc() : memref<1xi64>
affine.for %arg0 = 0 to 78 {
%dim_191 = memref.dim %alloc_82, %idx0 : memref<1xi64>
}
return
}
}
```
The above MLIR program will cause a crash when using the following command:
```
mlir-opt --affine-super-vectorize="virtual-vector-size=128" test.mlir
```
And the crash backtrace is:
```
<unknown>:0: error: failed to verify 'elementType': integer or index or floating-point
mlir-opt: /data/tmp/v0222/llvm-project/mlir/include/mlir/IR/StorageUniquerSupport.h:179: static ConcreteT mlir::detail::StorageUserBase<ConcreteT, BaseT, StorageT, UniquerT, Traits>::get(mlir::MLIRContext*, Args&& ...) [with Args = {llvm::ArrayRef<long int>&, mlir::Type&, llvm::ArrayRef<bool>&}; ConcreteT = mlir::VectorType; BaseT = mlir::Type; StorageT = mlir::detail::VectorTypeStorage; UniquerT = mlir::detail::TypeUniquer; Traits = {mlir::ShapedType::Trait, mlir::ValueSemantics}]: Assertion `succeeded( ConcreteT::verifyInvariants(getDefaultDiagnosticEmitFn(ctx), args...))' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /data/tmp/v0222/llvm-project/build/bin/mlir-opt --affine-super-vectorize=virtual-vector-size=128 test.mlir
#0 0x00005568e5168a5f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/tmp/v0222/llvm-project/build/bin/mlir-opt+0x167ba5f)
#1 0x00005568e5165ab4 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#2 0x00007f051bcda420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#3 0x00007f051b7a700b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
#4 0x00007f051b786859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
#5 0x00007f051b786729 (/lib/x86_64-linux-gnu/libc.so.6+0x22729)
#6 0x00007f051b797fd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
#7 0x00005568e82b4fc5 mlir::VectorType::get(llvm::ArrayRef<long>, mlir::Type, llvm::ArrayRef<bool>) (/data/tmp/v0222/llvm-project/build/bin/mlir-opt+0x47c7fc5)
#8 0x00005568e52c336c vectorizeOperand(mlir::Value, (anonymous namespace)::VectorizationState&) SuperVectorize.cpp:0:0
#9 0x00005568e52c38b9 widenOp(mlir::Operation*, (anonymous namespace)::VectorizationState&) SuperVectorize.cpp:0:0
#10 0x00005568e52c85e8 mlir::WalkResult llvm::function_ref<mlir::WalkResult (mlir::Operation*)>::callback_fn<vectorizeLoopNest(std::vector<llvm::SmallVector<mlir::affine::AffineForOp, 2u>, std::allocator<llvm::SmallVector<mlir::affine::AffineForOp, 2u>>>&, mlir::affine::VectorizationStrategy const&)::'lambda'(mlir::Operation*)>(long, mlir::Operation*) SuperVectorize.cpp:0:0
#11 0x00005568e52b43c0 mlir::WalkResult mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<mlir::WalkResult (mlir::Operation*)>, mlir::WalkOrder) (/data/tmp/v0222/llvm-project/build/bin/mlir-opt+0x17c73c0)
#12 0x00005568e52b4442 mlir::WalkResult mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<mlir::WalkResult (mlir::Operation*)>, mlir::WalkOrder) (/data/tmp/v0222/llvm-project/build/bin/mlir-opt+0x17c7442)
#13 0x00005568e52c5433 vectorizeLoopNest(std::vector<llvm::SmallVector<mlir::affine::AffineForOp, 2u>, std::allocator<llvm::SmallVector<mlir::affine::AffineForOp, 2u>>>&, mlir::affine::VectorizationStrategy const&) SuperVectorize.cpp:0:0
#14 0x00005568e52cab98 vectorizeLoops(mlir::Operation*, llvm::DenseSet<mlir::Operation*, llvm::DenseMapInfo<mlir::Operation*, void>>&, llvm::ArrayRef<long>, llvm::ArrayRef<long>, llvm::DenseMap<mlir::Operation*, llvm::SmallVector<mlir::affine::LoopReduction, 2u>, llvm::DenseMapInfo<mlir::Operation*, void>, llvm::detail::DenseMapPair<mlir::Operation*, llvm::SmallVector<mlir::affine::LoopReduction, 2u>>> const&) SuperVectorize.cpp:0:0
#15 0x00005568e52cbd0a (anonymous namespace)::Vectorize::runOnOperation() SuperVectorize.cpp:0:0
#16 0x00005568e8109d31 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/tmp/v0222/llvm-project/build/bin/mlir-opt+0x461cd31)
#17 0x00005568e810a1da mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/data/tmp/v0222/llvm-project/build/bin/mlir-opt+0x461d1da)
#18 0x00005568e810a56e mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::'lambda'(mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo&)::operator()(mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo&) const Pass.cpp:0:0
#19 0x00005568e81091bc mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool) (/data/tmp/v0222/llvm-project/build/bin/mlir-opt+0x461c1bc)
#20 0x00005568e8109a7b mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/tmp/v0222/llvm-project/build/bin/mlir-opt+0x461ca7b)
#21 0x00005568e810a1da mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/data/tmp/v0222/llvm-project/build/bin/mlir-opt+0x461d1da)
#22 0x00005568e810ad74 mlir::PassManager::run(mlir::Operation*) (/data/tmp/v0222/llvm-project/build/bin/mlir-opt+0x461dd74)
#23 0x00005568e80fc3cb performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#24 0x00005568e80fce32 processBuffer(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::MlirOptMainConfig const&, mlir::DialectRegistry&, llvm::ThreadPoolInterface*) MlirOptMain.cpp:0:0
#25 0x00005568e80fd0a4 llvm::LogicalResult llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::'lambda'(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#26 0x00005568e820195e mlir::splitAndProcessBuffer(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) (/data/tmp/v0222/llvm-project/build/bin/mlir-opt+0x471495e)
#27 0x00005568e80f3cb9 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/data/tmp/v0222/llvm-project/build/bin/mlir-opt+0x4606cb9)
#28 0x00005568e80fd211 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/tmp/v0222/llvm-project/build/bin/mlir-opt+0x4610211)
#29 0x00005568e80fd6d6 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/tmp/v0222/llvm-project/build/bin/mlir-opt+0x46106d6)
#30 0x00005568e508403b main (/data/tmp/v0222/llvm-project/build/bin/mlir-opt+0x159703b)
#31 0x00007f051b788083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#32 0x00005568e513937e _start (/data/tmp/v0222/llvm-project/build/bin/mlir-opt+0x164c37e)
Aborted (core dumped)
```
My git version is 93b2e47f12649bd33b99b88f25beb277a181274a.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs