[#llvm-SplitBlockAndInsertIfThenElse-0c7] = xref:llvm.adoc[llvm]::SplitBlockAndInsertIfThenElse :relfileprefix: ../ :mrdocs: Split a block and insert then/else branches at an instruction. == Synopsis Declared in `<llvm/Transforms/Utils/BasicBlockUtils.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void SplitBlockAndInsertIfThenElse( xref:llvm/Value.adoc[Value]* Cond, xref:llvm/Instruction.adoc[Instruction]* SplitBefore, xref:llvm/Instruction.adoc[Instruction]** ThenTerm, xref:llvm/Instruction.adoc[Instruction]** ElseTerm, xref:llvm/MDNode.adoc[MDNode]* BranchWeights = nullptr, xref:llvm/DomTreeUpdater.adoc[DomTreeUpdater]* DTU = nullptr, xref:llvm/LoopInfo.adoc[LoopInfo]* LI = nullptr); ---- == Parameters [cols="1,4"] |=== | Name| Description | *Cond* | Condition controlling the inserted branch. | *SplitBefore* | Instruction at which the block is split. | *ThenTerm* | Set to the terminator of the then‐block. | *ElseTerm* | Set to the terminator of the else‐block. | *BranchWeights* | Optional branch‐weight metadata for the new branch. | *DTU* | Optional dominator‐tree updater for CFG changes. | *LI* | Optional loop info to update. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#