Why loop simplify needs to transform multi backedges to nestedloop

Why does LLVM’s LoopSimplify pass need to first split the loop into inner and outer layers when the loop has multiple back edges, instead of directly redirecting all back edges to a new block when splitting is not possible? I believe this approach only moves some phi nodes to the outer loop but complicates the CFG structure, which is unfavorable for subsequent optimizations. The following is the commit log from LLVM, which shows that the splitting operation is still retained when the number of back edges is not too high. I am not clear about the benefits of this approach. Could someone kindly help explain? Thank you very much.

I don’t know what function/commit you are referring to (findPHIToPartitionLoops?), but often enough strange behavior results from wanting to fix a problem without makeing big impact changes.