[PATCH] D22888: Add verifyAnalysis for LCSSA.

Michael Zolotukhin via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 27 16:31:34 PDT 2016


mzolotukhin added inline comments.

================
Comment at: lib/Transforms/Utils/LCSSA.cpp:318
@@ -317,1 +317,3 @@
   bool runOnFunction(Function &F) override;
+  void verifyAnalysis() const override {
+    assert(
----------------
sanjoy wrote:
> mzolotukhin wrote:
> > sanjoy wrote:
> > > I'm missing something here -- how is LCSSA an "analysis" that can be "verified"?
> > I'm not very confident about this, but my understanding was that if a pass states that it preserves LCSSA (`AU.addPreservedID(LCSSAID)` like e.g. LoopSimplify does), then pass manager would run `verifyAnalysis` for `LCSSA`. In debugger this function is definitely entered several times.
> > 
> > I'd be happy to be corrected here, and add a verifier in some other way.
> Make sense, the `Analysis` part threw me off.
> 
> Does it make sense to use something that would work in release mode also?  Or is `verifyAnalysis` expected to be a no-op in non-debug builds?
> is `verifyAnalysis` expected to be a no-op in non-debug builds?
In `LegacyPassManager.cpp` it was
```
void PMDataManager::verifyPreservedAnalysis(Pass *P) {
  // Don't do this unless assertions are enabled.
#ifdef NDEBUG
  return;
#endif
...
```

So in Release+Assertions and Debug builds it should be on.


https://reviews.llvm.org/D22888





More information about the llvm-commits mailing list