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

Zequan Wu via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 7 11:12:12 PDT 2024


ZequanWu 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++) {
> ```

Yes, that fixes it. I'm trying to get a repro for it.

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


More information about the llvm-commits mailing list