Peels a single block loop. Loop must have two successors, one of which must be itself. Similarly it must have two predecessors, one of which must be itself.
Declared in <llvm/CodeGen/MachineLoopUtils.h>
MachineBasicBlock*
PeelSingleBlockLoop(
LoopPeelDirection Direction,
MachineBasicBlock* Loop,
MachineRegisterInfo& MRI,
TargetInstrInfo const* TII);
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.
| Name | Description |
|---|---|
| MRI | MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc. |
| TII | TargetInstrInfo - Interface to description of machine instruction set |