Peels a single block loop.
Declared in <llvm/CodeGen/MachineLoopUtils.h>
MachineBasicBlock*
PeelSingleBlockLoop(
LoopPeelDirection Direction,
MachineBasicBlock* Loop,
MachineRegisterInfo& MRI,
TargetInstrInfo const* TII);
Loop must have two successors, one of which must be itself. Similarly it must have two predecessors, one of which must be itself.
The loop block is copied and inserted into the CFG such that two copies of the loop follow on from each other. The copy is inserted either before or after the loop based on Direction.
Phis are updated and an unconditional branch inserted at the end of the clone so as to execute a single iteration.
The trip count of Loop is not updated.
The newly created peeled copy of the loop block.
| Name | Description |
|---|---|
| Direction | Whether to peel the first or last iteration. |
| Loop | The single-block loop to peel. |
| MRI | Register information used when updating phis and clones. |
| TII | Target instruction info used to insert the exit branch. |