diff options
author | Zhixun Tan <phisiart@gmail.com> | 2025-09-17 10:04:03 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-17 10:04:03 -0700 |
commit | 0227b791ff0860dca9c5a79fe229cfb1cb886db1 (patch) | |
tree | b8343cfec239b8882ed6cfa3b1c119fa18c9e5ff /clang/lib/CodeGen/CodeGenModule.h | |
parent | 2bf62e767119369e90670ca5bdd73a54193041e2 (diff) | |
download | llvm-0227b791ff0860dca9c5a79fe229cfb1cb886db1.zip llvm-0227b791ff0860dca9c5a79fe229cfb1cb886db1.tar.gz llvm-0227b791ff0860dca9c5a79fe229cfb1cb886db1.tar.bz2 |
[mlir][nfc] Minor cleanups in DeadCodeAnalysis (#159232)
* Remove `getOperandValuesImpl` since its only used once.
* Extract common logic from
`DeadCodeAnalysis::visitRegion{BranchOperation,Terminator}` into a new
function `DeadCodeAnalysis::visitRegionBranchEdges`.
In particular, both functions do the following:
* Detect live region branch edges (similar to CFGEdge);
* For each edge, mark the successor program point as executable (so that
subsequent program gets visited);
* For each edge, store the information of the predecessor op and
arguments (so that other analyses know what states to join into the
successor program point).
One caveat is that, before this PR, in `visitRegionTerminator`, the
successor program point is only marked as live if it is the start of a
block; after this PR, the successor program point is consistently marked
as live regardless what it is, which makes the behavior equal to
`visitBranchOperation`. This minor fix improves consistency, but at this
point it is still NFC, because the rest of the dataflow analysis
framework only cares about liveness at block level, and the liveness
information in the middle of a block isn't read anyway. This probably
will change once
[early-exits](https://discourse.llvm.org/t/rfc-region-based-control-flow-with-early-exits-in-mlir/76998)
are supported.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
0 files changed, 0 insertions, 0 deletions