Index: llvm/trunk/lib/Transforms/Utils/LCSSA.cpp =================================================================== --- llvm/trunk/lib/Transforms/Utils/LCSSA.cpp +++ llvm/trunk/lib/Transforms/Utils/LCSSA.cpp @@ -186,14 +186,14 @@ // Otherwise, do full PHI insertion. SSAUpdate.RewriteUse(*UseToRewrite); + } - // SSAUpdater might have inserted phi-nodes inside other loops. We'll need - // to post-process them to keep LCSSA form. - for (PHINode *InsertedPN : InsertedPHIs) { - if (auto *OtherLoop = LI.getLoopFor(InsertedPN->getParent())) - if (!L->contains(OtherLoop)) - PostProcessPHIs.push_back(InsertedPN); - } + // SSAUpdater might have inserted phi-nodes inside other loops. We'll need + // to post-process them to keep LCSSA form. + for (PHINode *InsertedPN : InsertedPHIs) { + if (auto *OtherLoop = LI.getLoopFor(InsertedPN->getParent())) + if (!L->contains(OtherLoop)) + PostProcessPHIs.push_back(InsertedPN); } // Post process PHI instructions that were inserted into another disjoint