Skip to content
Unverified Commit 6833a380 authored by Justin Fargnoli's avatar Justin Fargnoli Committed by GitHub
Browse files

[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`.
parent 508a697a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment