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