[llvm] [Analysis] Ignore convergence tokens in dead branches in `CodeMetrics` (PR #193590)

Finn Plummer via llvm-commits llvm-commits at lists.llvm.org
Tue May 5 09:48:47 PDT 2026


================
@@ -112,13 +113,39 @@ void CodeMetrics::collectEphemeralValues(
   completeEphemeralValues(Visited, Worklist, EphValues);
 }
 
+/// Check if a block was previously marked dead by setting the terminator to
+/// `unreachable` and their is a statically evaluated conditional branch to NOT
+/// branch to the block. This is done for instance within the unroll pass,
+/// between unrolling inner/outer loops.
----------------
inbelic wrote:

```suggestion
// Check if a block was previously marked dead by setting the terminator to
// `unreachable` and there are no branches that may branch to the block. We
// can only ensure a predecessor doesn't branch to this block if it is statically
// known not to. This is done for instance within the unroll pass, between
// unrolling inner/outer loops.
```

(removed the extra comment line as static functions shouldn't generate a doc)

https://github.com/llvm/llvm-project/pull/193590


More information about the llvm-commits mailing list