[NFC][SimplifyCFG] Hoist 'original' DomTree verification from simplifyOnce() into run()

This is NFC since SimplifyCFG still currently defaults to not preserving DomTree.

SimplifyCFGOpt::simplifyOnce() is only be called from SimplifyCFGOpt::run(),
and can not be called externally, since SimplifyCFGOpt is defined in .cpp
This avoids some needless verifications, and is thus a bit faster
without sacrificing precision.
This commit is contained in:
Roman Lebedev 2021-01-03 21:53:11 +03:00
parent a7684940f0
commit 98cd1c33e3
No known key found for this signature in database
GPG Key ID: 083C3EBB4A1689E0

View File

@ -6675,11 +6675,6 @@ bool SimplifyCFGOpt::simplifyOnceImpl(BasicBlock *BB) {
}
bool SimplifyCFGOpt::simplifyOnce(BasicBlock *BB) {
assert((!RequireAndPreserveDomTree ||
(DTU &&
DTU->getDomTree().verify(DominatorTree::VerificationLevel::Full))) &&
"Original domtree is invalid?");
bool Changed = simplifyOnceImpl(BB);
assert((!RequireAndPreserveDomTree ||
@ -6691,6 +6686,11 @@ bool SimplifyCFGOpt::simplifyOnce(BasicBlock *BB) {
}
bool SimplifyCFGOpt::run(BasicBlock *BB) {
assert((!RequireAndPreserveDomTree ||
(DTU &&
DTU->getDomTree().verify(DominatorTree::VerificationLevel::Full))) &&
"Original domtree is invalid?");
bool Changed = false;
// Repeated simplify BB as long as resimplification is requested.