LLVM  11.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_LIB_CODEGEN_MACHINELOOPUTILS_H
10 #define LLVM_LIB_CODEGEN_MACHINELOOPUTILS_H
11 
12 namespace llvm {
13 class MachineLoop;
14 class MachineBasicBlock;
15 class MachineRegisterInfo;
16 class TargetInstrInfo;
17 
19  LPD_Front, ///< Peel the first iteration of the loop.
20  LPD_Back ///< Peel the last iteration of the loop.
21 };
22 
23 /// Peels a single block loop. Loop must have two successors, one of which
24 /// must be itself. Similarly it must have two predecessors, one of which must
25 /// be itself.
26 ///
27 /// The loop block is copied and inserted into the CFG such that two copies of
28 /// the loop follow on from each other. The copy is inserted either before or
29 /// after the loop based on Direction.
30 ///
31 /// Phis are updated and an unconditional branch inserted at the end of the
32 /// clone so as to execute a single iteration.
33 ///
34 /// The trip count of Loop is not updated.
38  const TargetInstrInfo *TII);
39 
40 /// Return true if PhysReg is live outside the loop, i.e. determine if it
41 /// is live in the loop exit blocks, and false otherwise.
42 bool isRegLiveInExitBlocks(MachineLoop *Loop, int PhysReg);
43 
44 } // namespace llvm
45 
46 #endif // LLVM_LIB_CODEGEN_MACHINELOOPUTILS_H
This class represents lattice values for constants.
Definition: AllocatorList.h:23
bool isRegLiveInExitBlocks(MachineLoop *Loop, int PhysReg)
Return true if PhysReg is live outside the loop, i.e.
Peel the first iteration of the loop.
const HexagonInstrInfo * TII
TargetInstrInfo - Interface to description of machine instruction set.
unsigned const MachineRegisterInfo * MRI
Peel the last iteration of the loop.
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
Represents a single loop in the control flow graph.
Definition: LoopInfo.h:516
Loop::LoopBounds::Direction Direction
Definition: LoopInfo.cpp:228
MachineBasicBlock * PeelSingleBlockLoop(LoopPeelDirection Direction, MachineBasicBlock *Loop, MachineRegisterInfo &MRI, const TargetInstrInfo *TII)
Peels a single block loop.