This is an archive of the discontinued LLVM Phabricator instance.

Add verifyAnalysis for LCSSA.
ClosedPublic

Authored by mzolotukhin on Jul 27 2016, 3:25 PM.

Details

Summary

LCSSAWrapperPass currently doesn't override verifyAnalysis method, so pass
manager doesn't verify LCSSA. This patch adds the method so that we start
verifying LCSSA between loop passes.

Diff Detail

Repository
rL LLVM

Event Timeline

mzolotukhin retitled this revision from to Add verifyAnalysis for LCSSA..
mzolotukhin updated this object.
mzolotukhin added reviewers: chandlerc, sanjoy, hfinkel.
mzolotukhin added a subscriber: llvm-commits.
sanjoy added inline comments.Jul 27 2016, 3:44 PM
lib/Transforms/Utils/LCSSA.cpp
318 ↗(On Diff #65818)

I'm missing something here -- how is LCSSA an "analysis" that can be "verified"?

mzolotukhin added inline comments.Jul 27 2016, 3:54 PM
lib/Transforms/Utils/LCSSA.cpp
318 ↗(On Diff #65818)

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.

sanjoy added inline comments.Jul 27 2016, 4:20 PM
lib/Transforms/Utils/LCSSA.cpp
318 ↗(On Diff #65818)

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?

mzolotukhin added inline comments.Jul 27 2016, 4:31 PM
lib/Transforms/Utils/LCSSA.cpp
318 ↗(On Diff #65818)

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.

sanjoy accepted this revision.Jul 27 2016, 4:41 PM
sanjoy edited edge metadata.

lgtm

This revision is now accepted and ready to land.Jul 27 2016, 4:41 PM
This revision was automatically updated to reflect the committed changes.