LLVM  15.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 
12 namespace llvm {
13 class MachineBasicBlock;
14 class MachineRegisterInfo;
15 class TargetInstrInfo;
16 
18  LPD_Front, ///< Peel the first iteration of the loop.
19  LPD_Back ///< Peel the last iteration of the loop.
20 };
21 
22 /// Peels a single block loop. Loop must have two successors, one of which
23 /// must be itself. Similarly it must have two predecessors, one of which must
24 /// be itself.
25 ///
26 /// The loop block is copied and inserted into the CFG such that two copies of
27 /// the loop follow on from each other. The copy is inserted either before or
28 /// after the loop based on Direction.
29 ///
30 /// Phis are updated and an unconditional branch inserted at the end of the
31 /// clone so as to execute a single iteration.
32 ///
33 /// The trip count of Loop is not updated.
35  MachineBasicBlock *Loop,
36  MachineRegisterInfo &MRI,
37  const TargetInstrInfo *TII);
38 
39 } // namespace llvm
40 
41 #endif // LLVM_CODEGEN_MACHINELOOPUTILS_H
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::LPD_Front
@ LPD_Front
Peel the first iteration of the loop.
Definition: MachineLoopUtils.h:18
TII
const HexagonInstrInfo * TII
Definition: HexagonCopyToCombine.cpp:127
llvm::PeelSingleBlockLoop
MachineBasicBlock * PeelSingleBlockLoop(LoopPeelDirection Direction, MachineBasicBlock *Loop, MachineRegisterInfo &MRI, const TargetInstrInfo *TII)
Peels a single block loop.
Definition: MachineLoopUtils.cpp:26
llvm::LoopPeelDirection
LoopPeelDirection
Definition: MachineLoopUtils.h:17
MRI
unsigned const MachineRegisterInfo * MRI
Definition: AArch64AdvSIMDScalarPass.cpp:105
llvm::LPD_Back
@ LPD_Back
Peel the last iteration of the loop.
Definition: MachineLoopUtils.h:19
Direction
Loop::LoopBounds::Direction Direction
Definition: LoopInfo.cpp:226