XChy wrote: > I'm not sure how hard this would be for the case where we can thread across loop headers. While dom-tree is preserved during JumpThreading, I think it's easy to check whether an edge is backedge with it. https://github.com/llvm/llvm-project/pull/70664