[PATCH] D21118: Add a routine for LCSSA verification of entire function.

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 7 21:53:40 PDT 2016


sanjoy requested changes to this revision.
This revision now requires changes to proceed.

================
Comment at: lib/Transforms/Utils/LCSSA.cpp:274
@@ +273,3 @@
+/// Check if all loops in a loop nest are in LCSSA form.
+static bool isLoopNestInLCSSAForm(Loop &L, DominatorTree &DT) {
+  if (!L.isLCSSAForm(DT))
----------------
I think this basically is `Loop::isRecursivelyLCSSAForm`.

================
Comment at: lib/Transforms/Utils/LCSSA.cpp:288
@@ +287,3 @@
+bool llvm::isFunctionInLCSSAForm(Function &F, DominatorTree &DT, LoopInfo &LI) {
+  for (Loop *L : LI)
+    if (!isLoopNestInLCSSAForm(*L, DT))
----------------
I'm not super convinced that we need a new function here. :)

I think this can be:

```
all_of(LI, [&](Loop *L) { return L->isRecursiveLCSSAForm(DT); });
```

If you do want a new function, the logical place for it, IMO, is `LoopInfo`.


http://reviews.llvm.org/D21118





More information about the llvm-commits mailing list