[llvm] [CodeGen] Use optimized domtree for MachineFunction (PR #102107)

Alexis Engelke via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 6 22:36:48 PDT 2024


aengelke wrote:

Thanks for catching this! I can take a look, but could you provide instructions to reproduce this? (Or maybe you could try this patch and see whether this fixes the problem?)

```diff
diff --git a/llvm/lib/CodeGen/MachineBlockPlacement.cpp b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
index 9010c3cfc424..4ff24ee68b74 100644
--- a/llvm/lib/CodeGen/MachineBlockPlacement.cpp
+++ b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
@@ -3649,7 +3649,7 @@ void MachineBlockPlacement::assignBlockOrder(
     const std::vector<const MachineBasicBlock *> &NewBlockOrder) {
   assert(F->size() == NewBlockOrder.size() && "Incorrect size of block order");
   F->RenumberBlocks();
-  MPDT->updateBlockNumbers();
+  MPDT = nullptr;
 
   bool HasChanges = false;
   for (size_t I = 0; I < NewBlockOrder.size(); I++) {
```

https://github.com/llvm/llvm-project/pull/102107


More information about the llvm-commits mailing list