llvm::PeelSingleBlockLoop

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.

Synopsis

Declared in <llvm/CodeGen/MachineLoopUtils.h>

MachineBasicBlock*
PeelSingleBlockLoop(
    LoopPeelDirection Direction,
    MachineBasicBlock* Loop,
    MachineRegisterInfo& MRI,
    TargetInstrInfo const* TII);

Description

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.

Parameters

NameDescription
MRIMachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
TIITargetInstrInfo - Interface to description of machine instruction set