[llvm] [LICM] Use DomTreeUpdater version of SplitBlockPredecessors, nfc (PR #107190)

Joshua Cao via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 3 01:52:21 PDT 2024


caojoshua wrote:

I suppose the [SplitBlockPredecessors DTU implementation](https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp#L1163-L1172) is not that smart. If we have a lot of `Preds` we might have to re-evaluate the DomTree many times. It would be more efficient to just find the common dominator D and insert an edge from D to NewBB.

I think its better to not have separate APIs for DominatorTree and DomTreeUpdater. Maybe we can just call `DTU->getDomTree()->splitBlock()`?

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


More information about the llvm-commits mailing list