Issue 239940
Summary [MLIR][AMDGPU] `--canonicalize` asserts `dyn_cast on a non-existent value` in `FuseMemoryCounterWaitOp` when `amdgpu.memory_counter_wait` is the last op of a block without terminator
Labels crash, mlir:amdgpu, generated by fuzzer
Assignees
Reporter YuanchengJiang
    The following code:
```mlir
module {
 amdgpu.memory_counter_wait tensor(3)
}
```

Resulted in this output:
```
Program terminated with signal SIGSEGV (11)
Stack dump:
 #3 (anonymous namespace)::FuseMemoryCounterWaitOp::matchAndRewrite
 #4 mlir::PatternApplicator::matchAndRewrite
 #5 (anonymous namespace)::GreedyPatternRewriteDriver::processWorklist
 #6 mlir::applyPatternsGreedily
 #7 (anonymous namespace)::Canonicalizer::runOnOperation
 #8 mlir::detail::OpToOpPassAdaptor::run
 #9 mlir::detail::OpToOpPassAdaptor::runPipeline
#10 mlir::PassManager::run
```

Trunk reproducer (`--canonicalize`): https://godbolt.org/z/7fecaT3Eb
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to