[llvm] [SimplifyCFG] Avoid scanning functions multiple times in `removeUnreachableBlocks` (PR #213416)

Alexis Engelke via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 3 06:08:31 PDT 2026


aengelke wrote:

> Agree that computing reachability should be a graph-level problem, though it looks like past attempts to consolidate the two (DFS traversal and scanning the whole function body) didn't work out

I think one primary source of those "in-block unreachable instructions" is InstCombine to avoid modifying the CFG there? I haven't looked into the details where exactly, how often, and whether there are other sources. Removing the instruction walk is going to need more effort, but we can at least stop doing it that often.

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


More information about the llvm-commits mailing list