[PATCH] D138078: [CodeGenPrepare] split critical indirect edges from callbr w/ outputs

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 16 09:33:54 PST 2022


nickdesaulniers planned changes to this revision.
nickdesaulniers added a comment.

> the question "when is the best time to split critical edges" is perhaps important to consider.



In D138078#3929590 <https://reviews.llvm.org/D138078#3929590>, @efriedma wrote:

> You can't put transforms that are necessary for correctness in CodeGenPrepare; it isn't enabled at -O0.

Of course...

ok overnight I was thinking maybe we do the critical edge splitting on the MBB level based on if the BB has a critical edge (in `SelectionDAGBuilder::visitCallBr`).  Then I think we can remove the `isInlineAsmBrIndirectTarget` guard from `MachineBasicBlock::canSplitCriticalEdge` (I wonder if we always eagerly split critical edges, if we might be able to remove the `MachineBasicBlock::IsInlineAsmBrIndirectTarget` machinery outright, but that might be too aggressive).  Let me play with doing the splitting in `SelectionDAGBuilder::visitCallBr`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138078



More information about the llvm-commits mailing list