[PATCH] D21112: [LoopSimplify] Preserve LCSSA when merging exit blocks.

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


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

================
Comment at: lib/Transforms/Utils/LoopSimplify.cpp:753
@@ -750,2 +752,3 @@
       AU.addPreserved<SCEVAAWrapperPass>();
+      AU.addPreservedID(LCSSAID);
       AU.addPreserved<DependenceAnalysisWrapperPass>();
----------------
We should definitely add asserts verifying this.  I'd suggest something like

```
LoopSimplify::runOnFunction() {
#ifndef NDEBUG
  DenseSet<Loop *> InLCSSA;
  // put loops that are in LCSSA in InLCSSA
#endif

  .. do whatever it is that LoopSimplify does ..

#ifndef NDEBUG
  // assert every Loop in InLCSSA is in LCSSA
#endif
}
```

(i.e. we should also catch cases where simplifying a loop breaks LCSSA in another loop).

================
Comment at: lib/Transforms/Utils/LoopSimplify.cpp:786
@@ -785,3 +788,3 @@
   AC = &getAnalysis<AssumptionCacheTracker>().getAssumptionCache(F);
   bool PreserveLCSSA = mustPreserveAnalysisID(LCSSAID);
 
----------------
Can this be folded to `true`?  (I'm not asking you to do that in this change itself.)


http://reviews.llvm.org/D21112





More information about the llvm-commits mailing list