Return the branch that selects between predecessors of an if-merge block.
Declared in <llvm/Transforms/Utils/BasicBlockUtils.h>
CondBrInst*
GetIfCondition(
BasicBlock* BB,
BasicBlock*& IfTrue,
BasicBlock*& IfFalse);
Check whether BB is the merge point of a if-region. If so, return the branch instruction that determines which entry into BB will be taken. Also, return by references the block that will be entered from if the condition is true, and the block that will be entered if the condition is false.
This does no checking to see if the true/false blocks have large or unsavory instructions in them.
The conditional branch that selects between predecessors of BB, or null if BB is not an if-merge.
| Name | Description |
|---|---|
| BB | Candidate merge block of an if-region. |
| IfTrue | Set to the predecessor entered when the condition is true. |
| IfFalse | Set to the predecessor entered when the condition is false. |