Issue 128324
Summary [MLIR]`-test-print-topological-sort` triggers Assertion Failure `isa<To>(Val) && "cast<Ty>() argument of incompatible type!"'
Labels mlir
Assignees
Reporter xisang0
    Test on commit: https://github.com/llvm/llvm-project/commit/a9882bda96228ca23e166a817f93a7dbc99763cb
steps to reproduce:
```
mlir-opt test.mlir -test-print-topological-sort
```
test case:
```
module {
  func.func @f64_permuting_b(%a: f64, %b: f64, %c: vector<4xf64>) -> vector<4xf64> {
 %d = amdgpu.mfma %a * %b + %c {
      m = 16 : i32, n = 16 : i32, k = 4 : i32, blocks = 1 : i32,
      abid = 0 : i32, cbsz = 0 : i32
    } blgp = none : f64, f64, vector<4xf64>
    return %d : vector<4xf64>
 }
}
```
crash trace:
```
mlir-opt: /home/workdir/llvm-project-19/llvm/include/llvm/Support/Casting.h:578: decltype(auto) llvm::cast(From *) [To = mlir::SymbolOpInterface, From = mlir::Operation]: Assertion `isa<To>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
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/test.mlir -test-print-topological-sort
 #0 0x00005ee7bf753998 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (./mlir-opt+0x108a998)
 #1 0x00005ee7bf7514be llvm::sys::RunSignalHandlers() (./mlir-opt+0x10884be)
 #2 0x00005ee7bf7543a8 SignalHandler(int) Signals.cpp:0:0
 #3 0x000074bf66e32520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x000074bf66e869fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x000074bf66e32476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x000074bf66e187f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x000074bf66e1871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #8 0x000074bf66e29e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #9 0x00005ee7c1e3621f decltype(auto) llvm::cast<mlir::SymbolOpInterface, mlir::Operation>(mlir::Operation*) (./mlir-opt+0x376d21f)
#10 0x00005ee7c24d80fd (anonymous namespace)::TestTopologicalSortPass::runOnOperation() TestSlice.cpp:0:0
#11 0x00005ee7c2a243bf mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (./mlir-opt+0x435b3bf)
#12 0x00005ee7c2a24ba2 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (./mlir-opt+0x435bba2)
#13 0x00005ee7c2a2734e mlir::PassManager::run(mlir::Operation*) (./mlir-opt+0x435e34e)
#14 0x00005ee7c2a1fe6b performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#15 0x00005ee7c2a1facb 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 0x00005ee7c2ac8df5 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+0x43ffdf5)
#17 0x00005ee7c2a1a9b2 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (./mlir-opt+0x43519b2)
#18 0x00005ee7c2a1ac63 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x4351c63)
#19 0x00005ee7c2a1ae72 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x4351e72)
#20 0x00005ee7bf732c27 main (./mlir-opt+0x1069c27)
#21 0x000074bf66e19d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#22 0x000074bf66e19e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#23 0x00005ee7bf732795 _start (./mlir-opt+0x1069795)
Aborted (core dumped)
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to