nikic wrote: General loop peeling functionality is part of loop unroll, but that is understood in the sense of peeling a fixed number of iterations. Your transform looks like what LoopBoundSplit does. https://github.com/llvm/llvm-project/pull/102283