Moving deleteDeadLoop in LoopUtils like the FIXME in the comments is asking to be done.
I made it such that can update various analysis conditionally in case we are running it in a pass that doesn't preserve those analysis anyway
These comments are stale now. Please update.
These comments are stale now. The 2 kinds of "dead" loops were specific to loop deletion.
Please state as a comment that we also have certain requirements on the structure of the loop and the deletion works by connecting the preheader directly to the exit. (these conditions have been specified as asserts below: preheader has exactly one successors, we have exactly one exit block etc).
This second part is incorrect. We can have any number of predecessors to the exit block, we just remove all the predecessors (because these are from the dead loop) and set the preheader as the only predecessor of the exit block.
Pls rmove the second part of the statement.
What I meant with that is that the predecessors of the exit need to be only blocks from the loop (aka. The loop has dedicated exits).
That should be a requirement for the function (There's an assert for that). I'll reword it by just saying that the exit needs to be dedicated.
LGTM with nits.
Could you phrase it as "a unique dedicated exit block must exist".
Btw, please keep this explanation in the LoopUtils header. We don't need to repeat it here. I think that's the convention we follow in llvm header and cpp files, to avoid repetition.