[llvm-dev] Successors of MBB

Björn Pettersson A via llvm-dev llvm-dev at lists.llvm.org
Wed Apr 21 07:03:18 PDT 2021


Worth mentioning is perhaps that machine optimizations such as BranchFolding and IfConversion probably only handle simple cases with one or two successors (possibly depending on your analyzeBranch implementation for your backend). See https://llvm.org/docs/WritingAnLLVMBackend.html#branch-folding-and-if-conversion
So while there is no restriction to the number of successors, there might be implications when it comes to the amount of optimizations done if you have more than two successors.

/Björn

From: llvm-dev <llvm-dev-bounces at lists.llvm.org> On Behalf Of Krzysztof Parzyszek via llvm-dev
Sent: den 20 april 2021 18:25
To: Svetlana Getmanskaya <Svetlana.Getmanskaya at mir.dev>
Cc: llvm-dev <llvm-dev at lists.llvm.org>
Subject: Re: [llvm-dev] Successors of MBB

There is no restriction.  For example, indirect branches can have multiple (more than two) targets.

--
Krzysztof Parzyszek  kparzysz at quicinc.com<mailto:kparzysz at quicinc.com>   AI tools development

From: llvm-dev <llvm-dev-bounces at lists.llvm.org<mailto:llvm-dev-bounces at lists.llvm.org>> On Behalf Of Svetlana Getmanskaya via llvm-dev
Sent: Monday, April 19, 2021 6:52 AM
To: llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>
Subject: [EXT] [llvm-dev] Successors of MBB

Hello All,
In my implementation of EmitInstrWithCustomInserter I have two branches in machine basic block so this MBB has 3 successors (two from branches and one fallthrough) but I've not found such a solution in other targets. I wonder if there is any restriction for the number of successors for MBB?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210421/363aed60/attachment.html>


More information about the llvm-dev mailing list