[IndVars] Have getInsertPointForUses preserve LCSSA
[oota-llvm.git] / lib / Analysis / LoopInfo.cpp
index e679b7ad7b86a17987ef0743e62e3670f9cf074f..67a82b192e5638d56e35b162a6654198b23bc959 100644 (file)
@@ -200,6 +200,15 @@ bool Loop::isLCSSAForm(DominatorTree &DT) const {
   return true;
 }
 
+bool Loop::isRecursivelyLCSSAForm(DominatorTree &DT) const {
+  if (!isLCSSAForm(DT))
+    return false;
+
+  return std::all_of(begin(), end(), [&](const Loop *L) {
+    return L->isRecursivelyLCSSAForm(DT);
+  });
+}
+
 /// isLoopSimplifyForm - Return true if the Loop is in the form that
 /// the LoopSimplify form transforms loops to, which is sometimes called
 /// normal form.