[mlir][DeadCodeAnalysis] Don't Require `RegionBranchTerminatorOpInterface` in...
[mlir][DeadCodeAnalysis] Don't Require `RegionBranchTerminatorOpInterface` in `visitRegionTerminator()` (#69043) Fix for a crash reported in #64975. The crash occurs in the cast located [here](https://github.com/llvm/llvm-project/blob/ece5dd101c7e4dc2fd23428abd312f75fd3d3eaf/mlir/lib/Analysis/DataFlow/DeadCodeAnalysis.cpp#L262) because `llvm.unreachable` doesn't implement `RegionBranchTerminatorOpInterface`. The crash is caused by `DeadCodeAnalysis` assuming that `isa<RegionBranchOpInterface>(op->getParentOp())` implies `isa<RegionBranchTerminatorOpInterface>(op)` in `DeadCodeAnalysis::visit()`. This patch tried to fix this by enabling the analysis to proceed regardless of whether `op` is a `RegionBranchTerminatorOpInterface`.
Loading
Please sign in to comment