[PATCH] D153638: [CodeGenPrepare][NFC] Update the dominator tree instead of rebuilding it

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 00:18:32 PDT 2023


dmgreen added a comment.

This seems to look OK, right? I know there are dragons here with some functions, but it looks like the compile time is better and it seems like a better design to keep the DomTree up to date, if we can do so without destroying compile time.



================
Comment at: llvm/lib/CodeGen/CodeGenPrepare.cpp:609
+#ifndef NDEBUG
+    if (VerifyDT)
+      assert(getDT().verify(DominatorTree::VerificationLevel::Fast) &&
----------------
This should be less indented?


================
Comment at: llvm/lib/CodeGen/CodeGenPrepare.cpp:691
 
+  // LoopInfo is not needed anymore and ConstantrFoldTerminator can break it.
+  LI = nullptr;
----------------
ConstantFoldTerminator


================
Comment at: llvm/lib/CodeGen/CodeGenPrepare.cpp:897
 /// blocks so we can split them the way we want them.
-bool CodeGenPrepare::eliminateMostlyEmptyBlocks(Function &F) {
+bool CodeGenPrepare::eliminateMostlyEmptyBlocks(Function &F, ModifyDT &ModifiedDT) {
   SmallPtrSet<BasicBlock *, 16> Preheaders;
----------------
As a general rule you should probably just run clang-format on any patch you upload :)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153638/new/

https://reviews.llvm.org/D153638



More information about the llvm-commits mailing list