LLVM 24.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 {
18class TargetInstrInfo;
19
21 LPD_Front, ///< Peel the first iteration of the loop.
22 LPD_Back ///< Peel the last iteration of the loop.
23};
24
25/// Peels a single block loop. Loop must have two successors, one of which
26/// must be itself. Similarly it must have two predecessors, one of which must
27/// be itself.
28///
29/// The loop block is copied and inserted into the CFG such that two copies of
30/// the loop follow on from each other. The copy is inserted either before or
31/// after the loop based on Direction.
32///
33/// Phis are updated and an unconditional branch inserted at the end of the
34/// clone so as to execute a single iteration.
35///
36/// The trip count of Loop is not updated. If \p MDTU is not null, it is
37/// updated for the CFG changes.
38LLVM_ABI MachineBasicBlock *
40 MachineRegisterInfo &MRI, const TargetInstrInfo *TII,
41 MachineDomTreeUpdater *MDTU = nullptr);
42
43} // namespace llvm
44
45#endif // LLVM_CODEGEN_MACHINELOOPUTILS_H
#define LLVM_ABI
Definition Compiler.h:211
const HexagonInstrInfo * TII
Loop::LoopBounds::Direction Direction
Definition LoopInfo.cpp:254
MachineRegisterInfo & MRI
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, MachineDomTreeUpdater *MDTU=nullptr)
Peels a single block loop.
@ LPD_Back
Peel the last iteration of the loop.
@ LPD_Front
Peel the first iteration of the loop.