[SimplifyCFG] Don't actually take DomTreeUpdater unless we intend to maintain DomTree validity

This guards against unintentional mistakes
like the one i just fixed in previous commit.
This commit is contained in:
Roman Lebedev 2021-01-02 14:40:55 +03:00
parent f4ea21947d
commit b9da488ad7
No known key found for this signature in database
GPG Key ID: 083C3EBB4A1689E0
1 changed files with 2 additions and 2 deletions

View File

@ -6700,7 +6700,7 @@ bool SimplifyCFGOpt::run(BasicBlock *BB) {
bool llvm::simplifyCFG(BasicBlock *BB, const TargetTransformInfo &TTI,
DomTreeUpdater *DTU, const SimplifyCFGOptions &Options,
SmallPtrSetImpl<BasicBlock *> *LoopHeaders) {
return SimplifyCFGOpt(TTI, DTU, BB->getModule()->getDataLayout(), LoopHeaders,
Options)
return SimplifyCFGOpt(TTI, RequireAndPreserveDomTree ? DTU : nullptr,
BB->getModule()->getDataLayout(), LoopHeaders, Options)
.run(BB);
}