This is an archive of the discontinued LLVM Phabricator instance.

[DomTree] Add API forceVerifyDomTree
ClosedPublic

Authored by anemet on Apr 2 2015, 11:09 PM.

Details

Reviewers
anemet
hfinkel
Summary

This API bypasses the -verify-dom-info flag to always check DT
consistency. This is useful to stress-test a single pass without
slowing down other passes.

Looks like the LoopVectorizer was trying to do something similar when it
calls verifyDomTree directly. That's a no-op unless -verify-dom-info is
used. But if -verify-dom-info is passed the verification would be run
anyway. We should probably also fix this in LV.

Diff Detail

Event Timeline

anemet updated this revision to Diff 23205.Apr 2 2015, 11:09 PM
anemet retitled this revision from to [DomTree] Add API forceVerifyDomTree.
anemet updated this object.
anemet edited the test plan for this revision. (Show Details)
anemet added a reviewer: hfinkel.
anemet added a subscriber: Unknown Object (MLST).
reames added a subscriber: reames.Apr 9 2015, 10:01 AM

LGTM. I would mildly prefer a boolean parameter to verifyDomTree with a default value, but I'm okay with either version.

You might also consider making the force version declaration under a #ifndef NDEBUG to ensure it doesn't accidentally get left on in a release build.

LGTM. I would mildly prefer a boolean parameter to verifyDomTree with a default value, but I'm okay with either version.

Thanks. I'll make that change -- fewer functions to remember.

anemet updated this revision to Diff 23809.Apr 15 2015, 4:03 PM

Philip,

Rather than introducing another API flag besides the -verify-dom-info
command-line flag, I've decided to clean this up.

The new commit log should explain the situation:

[DomTree] verifyDomTree to unconditionally perform DT verification

I folded the check for the flag -verify-dom-info into the only caller
where I think it is supposed to be checked: verifyAnalysis.  (The idea
of the flag is to enable this expensive verification in
verifyPreservedAnalysis.)

I'm assuming that when manually scheduling the verification pass with
-passes=verify<domtree>, we do want to perform the verification, so I
don't check for the flag there.

Please let me know if you're OK with this.

Thanks,
Adam

anemet accepted this revision.May 6 2015, 1:22 AM
anemet added a reviewer: anemet.
This revision is now accepted and ready to land.May 6 2015, 1:22 AM
anemet closed this revision.May 6 2015, 1:23 AM

It's r236575, thanks Philip.