This fixes https://bugs.llvm.org/show_bug.cgi?id=49185
When NDEBUG is not set, LPMUpdater checks if the added loops have the same parent loop as the current one in addSiblingLoops.
If multiple loop passes are executed through LoopPassManager, U.ParentL will be the same across all passes.
However, the parent loop might change after running a loop pass, resulting in assertion failures in subsequent passes.
This patch resets U.ParentL after running individual loop passes in LoopPassManager.
I don't know this code at all, but I have to say I feel a little bit uneasy about a bugfix that only adds stuff guarded by #ifndef NDEBUG.
I'm not saying it's the case here because I don't know at all, but this *could* mean that we only fix the problem when compiling with asserts, and then in a production build the bug still exist.
Would it hurt much to always set the parent loop so it's worth putting it in an ifndef?