LLVM 23.0.0git
MachineLoopUtils.h
Go to the documentation of this file.
1//=- MachineLoopUtils.h - Helper functions for manipulating loops -*- C++ -*-=//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_CODEGEN_MACHINELOOPUTILS_H
10#define LLVM_CODEGEN_MACHINELOOPUTILS_H
11
13
14namespace llvm {
17class TargetInstrInfo;
18
20 LPD_Front, ///< Peel the first iteration of the loop.
21 LPD_Back ///< Peel the last iteration of the loop.
22};
23
24/// Peels a single block loop. Loop must have two successors, one of which
25/// must be itself. Similarly it must have two predecessors, one of which must
26/// be itself.
27///
28/// The loop block is copied and inserted into the CFG such that two copies of
29/// the loop follow on from each other. The copy is inserted either before or
30/// after the loop based on Direction.
31///
32/// Phis are updated and an unconditional branch inserted at the end of the
33/// clone so as to execute a single iteration.
34///
35/// The trip count of Loop is not updated.
37 MachineBasicBlock *Loop,
38 MachineRegisterInfo &MRI,
39 const TargetInstrInfo *TII);
40
41} // namespace llvm
42
43#endif // LLVM_CODEGEN_MACHINELOOPUTILS_H
#define LLVM_ABI
Definition Compiler.h:213
const HexagonInstrInfo * TII
Loop::LoopBounds::Direction Direction
Definition LoopInfo.cpp:253
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
TargetInstrInfo - Interface to description of machine instruction set.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI MachineBasicBlock * PeelSingleBlockLoop(LoopPeelDirection Direction, MachineBasicBlock *Loop, MachineRegisterInfo &MRI, const TargetInstrInfo *TII)
Peels a single block loop.
@ LPD_Back
Peel the last iteration of the loop.
@ LPD_Front
Peel the first iteration of the loop.