Fold a setcc-and-branch block into a predecessor that already targets both.
Declared in <llvm/Transforms/Utils/Local.h>
bool
foldBranchToCommonDest(
CondBrInst* BI,
llvm::DomTreeUpdater* DTU = nullptr,
MemorySSAUpdater* MSSAU = nullptr,
TargetTransformInfo const* TTI = nullptr,
AssumptionCache* AC = nullptr,
unsigned int BonusInstThreshold = 1);
If this basic block is ONLY a setcc and a branch, and if a predecessor branches to us and one of our successors, fold the setcc into the predecessor and use logical operations to pick the right destination.
True if the branch was folded into a predecessor.
| Name | Description |
|---|---|
| BI | Conditional branch that may be folded into a predecessor. |
| DTU | Optional dominator-tree updater for CFG changes. |
| MSSAU | Optional MemorySSA updater for moved or deleted instructions. |
| TTI | Optional target transform info used for profitability checks. |
| AC | Optional assumption cache used during folding. |
| BonusInstThreshold | Maximum bonus instructions allowed when folding. |