Issue |
131098
|
Summary |
[MLIR] 'gpu.launch_func' crashed on SymbolUsesPass
|
Labels |
mlir
|
Assignees |
|
Reporter |
sweead
|
Test commit: https://github.com/llvm/llvm-project/commit/9e91725fd4d4ee30e98ab2682f93b423590a4ade
Steps to reproduce:
```shell
mlir-opt test.mlir -test-symbol-uses
```
Test case:
```mlir
module attributes {gpu.container_module} {
func.func @main(%arg0: tensor<4x4xf32>) attributes {pattern_driver_all_erased = true, pattern_driver_changed = false} {
%0 = llvm.mlir.constant(128 : index) : i64
%1 = llvm.mlir.constant(1 : index) : i64
%2 = builtin.unrealized_conversion_cast %1 : i64 to index
%3 = builtin.unrealized_conversion_cast %0 : i64 to index
%4 = gpu.wait async
%5 = gpu.launch_func async [%4] @main_kernel::@main_kernel blocks in (%2, %2, %2) threads in (%2, %2, %2) args(%3 : index)
return
}
gpu.module @main_kernel {
gpu.func @main_kernel(%arg0: index) kernel attributes {known_block_size = array<i32: 1, 1, 1>} {
gpu.return
}
}
}
```
Crash trace:
```console
10.mlir:2:3: remark: symbol contains 1 nested references
func.func @main(%arg0: tensor<4x4xf32>) attributes {pattern_driver_all_erased = true, pattern_driver_changed = false} {
^
10.mlir:2:3: note: see current operation:
func.func @main(%arg0: tensor<4x4xf32>) attributes {pattern_driver_all_erased = true, pattern_driver_changed = false} {
%0 = llvm.mlir.constant(128 : index) : i64
%1 = llvm.mlir.constant(1 : index) : i64
%2 = builtin.unrealized_conversion_cast %1 : i64 to index
%3 = builtin.unrealized_conversion_cast %0 : i64 to index
%4 = gpu.wait async
%5 = gpu.launch_func async [%4] @main_kernel::@main_kernel blocks in (%2, %2, %2) threads in (%2, %2, %2) args(%3 : index)
return
}
10.mlir:2:3: remark: symbol has no uses
func.func @main(%arg0: tensor<4x4xf32>) attributes {pattern_driver_all_erased = true, pattern_driver_changed = false} {
^
10.mlir:2:3: note: see current operation:
func.func @main(%arg0: tensor<4x4xf32>) attributes {pattern_driver_all_erased = true, pattern_driver_changed = false} {
%0 = llvm.mlir.constant(128 : index) : i64
%1 = llvm.mlir.constant(1 : index) : i64
%2 = builtin.unrealized_conversion_cast %1 : i64 to index
%3 = builtin.unrealized_conversion_cast %0 : i64 to index
%4 = gpu.wait async
%5 = gpu.launch_func async [%4] @main_kernel::@main_kernel blocks in (%2, %2, %2) threads in (%2, %2, %2) args(%3 : index)
return
}
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /home/workdir/llvm-project/build/bin/./mlir-opt test.mlir --test-symbol-uses
#0 0x0000564b56312228 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/workdir/llvm-project/build/bin/./mlir-opt+0x12d1228)
#1 0x0000564b5630fd4e llvm::sys::RunSignalHandlers() (/home/workdir/llvm-project/build/bin/./mlir-opt+0x12ced4e)
#2 0x0000564b56312c31 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x00007f5ac4fb8520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00007f5ac500c9fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#5 0x00007f5ac4fb8476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#6 0x00007f5ac4f9e7f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#7 0x0000564b562fef9f (/home/workdir/llvm-project/build/bin/./mlir-opt+0x12bdf9f)
#8 0x0000564b59a949a1 mlir::WalkResult llvm::function_ref<mlir::WalkResult (mlir::Operation*)>::callback_fn<(anonymous namespace)::SymbolUsesPass::runOnOperation()::'lambda'(mlir::Operation*)>(long, mlir::Operation*) TestSymbolUses.cpp:0:0
#9 0x0000564b564422d7 mlir::WalkResult mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<mlir::WalkResult (mlir::Operation*)>, mlir::WalkOrder) (/home/workdir/llvm-project/build/bin/./mlir-opt+0x14012d7)
#10 0x0000564b59a93f2a (anonymous namespace)::SymbolUsesPass::runOnOperation() TestSymbolUses.cpp:0:0
#11 0x0000564b59408cd3 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/home/workdir/llvm-project/build/bin/./mlir-opt+0x43c7cd3)
#12 0x0000564b59409572 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/home/workdir/llvm-project/build/bin/./mlir-opt+0x43c8572)
#13 0x0000564b5940bd4e mlir::PassManager::run(mlir::Operation*) (/home/workdir/llvm-project/build/bin/./mlir-opt+0x43cad4e)
#14 0x0000564b594042cb performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#15 0x0000564b59403f23 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 0x0000564b594af475 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) (/home/workdir/llvm-project/build/bin/./mlir-opt+0x446e475)
#17 0x0000564b593fdb82 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/home/workdir/llvm-project/build/bin/./mlir-opt+0x43bcb82)
#18 0x0000564b593fde33 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/home/workdir/llvm-project/build/bin/./mlir-opt+0x43bce33)
#19 0x0000564b593fe042 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/home/workdir/llvm-project/build/bin/./mlir-opt+0x43bd042)
#20 0x0000564b562f19af main (/home/workdir/llvm-project/build/bin/./mlir-opt+0x12b09af)
#21 0x00007f5ac4f9fd90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#22 0x00007f5ac4f9fe40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#23 0x0000564b562f1505 _start (/home/workdir/llvm-project/build/bin/./mlir-opt+0x12b0505)
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs