[llvm-branch-commits] [llvm] b9da488 - [SimplifyCFG] Don't actually take DomTreeUpdater unless we intend to maintain DomTree validity

Roman Lebedev via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sat Jan 2 04:04:26 PST 2021


Author: Roman Lebedev
Date: 2021-01-02T14:40:55+03:00
New Revision: b9da488ad729a6604439d1b5e456330bab9321bd

URL: https://github.com/llvm/llvm-project/commit/b9da488ad729a6604439d1b5e456330bab9321bd
DIFF: https://github.com/llvm/llvm-project/commit/b9da488ad729a6604439d1b5e456330bab9321bd.diff

LOG: [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.

Added: 
    

Modified: 
    llvm/lib/Transforms/Utils/SimplifyCFG.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index fa12d8b99644..e1f7ef636a89 100644
--- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -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);
 }


        


More information about the llvm-branch-commits mailing list