Simplify the CFG around a basic block with peephole optimizations.
Declared in <llvm/Transforms/Utils/Local.h>
bool
simplifyCFG(
BasicBlock* BB,
TargetTransformInfo const& TTI,
DomTreeUpdater* DTU = nullptr,
SimplifyCFGOptions const& Options = {},
ArrayRef<WeakVH> LoopHeaders = {});
This function is used to do simplification of a CFG. For example, it adjusts branches to branches to eliminate the extra hop, it eliminates unreachable basic blocks, and does other peephole optimization of the CFG. It returns true if a modification was made, possibly deleting the basic block that was pointed to. LoopHeaders is an optional input parameter providing the set of loop headers that SimplifyCFG should not eliminate.
True if any CFG modification was made.
| Name | Description |
|---|---|
| BB | Basic block to simplify. |
| TTI | Target transform info used for cost decisions. |
| DTU | Optional dominator-tree updater for CFG changes. |
| Options | Extra SimplifyCFG knobs. |
| LoopHeaders | Optional loop headers that must not be eliminated. |