-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
crashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]mlir:affine
Description
Test on commit: 38fffa6
steps to reproduce:
./mlir-opt test.mlir --affine-loop-fusion
test case:
#map = affine_map<(d0, d1) -> (d0 + d1)>
module {
spirv.func @test_avgpool2d_pad_right(%arg0: !spirv.array<8192 x f32>) -> !spirv.array<8192 x f32> "None" {
%cst_f32 = spirv.Constant 0.000000e+00 : f32
%0 = builtin.unrealized_conversion_cast %arg0 : !spirv.array<8192 x f32> to tensor<1x32x32x8xf32>
%padded = tensor.pad %0 low[0, 4, 4, 0] high[0, 4, 8193, 0] {
^bb0(%arg1: index, %arg2: index, %arg3: index, %arg4: index):
tensor.yield %cst_f32 : f32
} : tensor<1x32x32x8xf32> to tensor<1x40x8229x8xf32>
%1 = bufferization.to_memref %padded : memref<1x40x8229x8xf32>
%alloc_0 = memref.alloc() {alignment = 64 : i64} : memref<1x32x32x8xf32>
affine.for %arg1 = 0 to 1 {
affine.for %arg2 = 0 to 32 {
affine.for %arg3 = 0 to 32 {
affine.for %arg4 = 0 to 8 {
affine.for %arg5 = 0 to 1 {
affine.for %arg6 = 0 to 1 {
%4 = affine.apply #map(%arg2, %arg5)
%5 = affine.apply #map(%arg3, %arg6)
%6 = affine.load %1[%arg1, %4, %5, %arg4] : memref<1x40x8229x8xf32>
%7 = affine.load %alloc_0[%arg1, %arg2, %arg3, %arg4] : memref<1x32x32x8xf32>
%8 = arith.addf %7, %6 : f32
affine.store %8, %alloc_0[%arg1, %arg2, %arg3, %arg4] : memref<1x32x32x8xf32>
}
}
}
}
}
}
%alloc_1 = memref.alloc() {alignment = 64 : i64} : memref<1x32x32x8xf32>
affine.for %arg1 = 0 to 1 {
affine.for %arg2 = 0 to 32 {
affine.for %arg3 = 0 to 32 {
affine.for %arg4 = 0 to 8 {
%4 = affine.load %alloc_0[%arg1, %arg2, %arg3, %arg4] : memref<1x32x32x8xf32>
}
}
}
}
%2 = bufferization.to_tensor %alloc_1 : memref<1x32x32x8xf32>
%3 = builtin.unrealized_conversion_cast %2 : tensor<1x32x32x8xf32> to !spirv.array<8192 x f32>
spirv.ReturnValue %3 : !spirv.array<8192 x f32>
}
}
crash trace:
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 /home/workdir/test10.mlir --affine-loop-fusion
#0 0x00005ae09bf9b258 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (./mlir-opt+0x1068258)
#1 0x00005ae09bf98d7e llvm::sys::RunSignalHandlers() (./mlir-opt+0x1065d7e)
#2 0x00005ae09bf9bc68 SignalHandler(int) Signals.cpp:0:0
#3 0x000073412f1e5520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00005ae09c0e60a6 mlir::affine::promoteIfSingleIteration(mlir::affine::AffineForOp) (./mlir-opt+0x11b30a6)
#5 0x00005ae09c0e13a5 mlir::affine::fuseLoops(mlir::affine::AffineForOp, mlir::affine::AffineForOp, mlir::affine::ComputationSliceState const&, bool) (./mlir-opt+0x11ae3a5)
#6 0x00005ae09c0b5d15 (anonymous namespace)::GreedyFusion::performFusionsIntoDest(unsigned int, unsigned int) LoopFusion.cpp:0:0
#7 0x00005ae09c0b39f5 (anonymous namespace)::GreedyFusion::fuseProducerConsumerNodes(unsigned int) LoopFusion.cpp:0:0
#8 0x00005ae09c0b3475 void llvm::function_ref<void (mlir::Operation*)>::callback_fn<(anonymous namespace)::LoopFusion::runOnOperation()::$_0>(long, mlir::Operation*) LoopFusion.cpp:0:0
#9 0x00005ae09c0a95be void mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) (./mlir-opt+0x11765be)
#10 0x00005ae09c0b074d (anonymous namespace)::LoopFusion::runOnOperation() LoopFusion.cpp:0:0
#11 0x00005ae09f1ceb1f mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (./mlir-opt+0x429bb1f)
#12 0x00005ae09f1cf302 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (./mlir-opt+0x429c302)
#13 0x00005ae09f1d1aae mlir::PassManager::run(mlir::Operation*) (./mlir-opt+0x429eaae)
#14 0x00005ae09f1ca5d2 performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#15 0x00005ae09f1ca23b 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&)::$_0>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#16 0x00005ae09f273f25 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) (./mlir-opt+0x4340f25)
#17 0x00005ae09f1c5432 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (./mlir-opt+0x4292432)
#18 0x00005ae09f1c56e3 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x42926e3)
#19 0x00005ae09f1c58f2 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x42928f2)
#20 0x00005ae09bf7a477 main (./mlir-opt+0x1047477)
#21 0x000073412f1ccd90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#22 0x000073412f1cce40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#23 0x00005ae09bf79fe5 _start (./mlir-opt+0x1046fe5)
Segmentation fault (core dumped)
Metadata
Metadata
Assignees
Labels
crashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]mlir:affine