nikic wrote: The other problem here is that LoopHeaders may not be up-to-date. As it was previously only used for heuristics, using it for correctness now may be a bit iffy. https://github.com/llvm/llvm-project/pull/70664