[all-commits] [llvm/llvm-project] 6833a3: [mlir][DeadCodeAnalysis] Don't Require `RegionBran...
Justin Fargnoli via All-commits
all-commits at lists.llvm.org
Sun Oct 22 15:34:52 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 6833a3808f7ba14247f3ce13d68df0bca991f354
https://github.com/llvm/llvm-project/commit/6833a3808f7ba14247f3ce13d68df0bca991f354
Author: Justin Fargnoli <34139864+justinfargnoli at users.noreply.github.com>
Date: 2023-10-22 (Sun, 22 Oct 2023)
Changed paths:
M mlir/include/mlir/Analysis/DataFlow/DeadCodeAnalysis.h
M mlir/lib/Analysis/DataFlow/DeadCodeAnalysis.cpp
M mlir/test/Analysis/DataFlow/test-dead-code-analysis.mlir
Log Message:
-----------
[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`.
More information about the All-commits
mailing list