LLVM  4.0.0
UnrollLoop.h
Go to the documentation of this file.
1 //===- llvm/Transforms/Utils/UnrollLoop.h - Unrolling utilities -*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines some loop unrolling utilities. It does not define any
11 // actual pass or policy, but provides a single function to perform loop
12 // unrolling.
13 //
14 //===----------------------------------------------------------------------===//
15 
16 #ifndef LLVM_TRANSFORMS_UTILS_UNROLLLOOP_H
17 #define LLVM_TRANSFORMS_UTILS_UNROLLLOOP_H
18 
19 // Needed because we can't forward-declare the nested struct
20 // TargetTransformInfo::UnrollingPreferences
22 
23 namespace llvm {
24 
25 class StringRef;
26 class AssumptionCache;
27 class DominatorTree;
28 class Loop;
29 class LoopInfo;
30 class LPPassManager;
31 class MDNode;
32 class Pass;
33 class OptimizationRemarkEmitter;
35 
37 
38 const Loop* addClonedBlockToLoopInfo(BasicBlock *OriginalBB,
39  BasicBlock *ClonedBB, LoopInfo *LI,
40  NewLoopsMap &NewLoops);
41 
42 bool UnrollLoop(Loop *L, unsigned Count, unsigned TripCount, bool Force,
43  bool AllowRuntime, bool AllowExpensiveTripCount,
44  bool PreserveCondBr, bool PreserveOnlyFirst,
45  unsigned TripMultiple, unsigned PeelCount, LoopInfo *LI,
47  OptimizationRemarkEmitter *ORE, bool PreserveLCSSA);
48 
49 bool UnrollRuntimeLoopRemainder(Loop *L, unsigned Count,
50  bool AllowExpensiveTripCount,
51  bool UseEpilogRemainder, LoopInfo *LI,
53  bool PreserveLCSSA);
54 
55 void computePeelCount(Loop *L, unsigned LoopSize,
57 
58 bool peelLoop(Loop *L, unsigned PeelCount, LoopInfo *LI, ScalarEvolution *SE,
59  DominatorTree *DT, bool PreserveLCSSA);
60 
62 }
63 
64 #endif
MachineLoop * L
aarch64 AArch64 CCMP Pass
The main scalar evolution driver.
A cache of .assume calls within a function.
Metadata node.
Definition: Metadata.h:830
bool UnrollLoop(Loop *L, unsigned Count, unsigned TripCount, bool Force, bool AllowRuntime, bool AllowExpensiveTripCount, bool PreserveCondBr, bool PreserveOnlyFirst, unsigned TripMultiple, unsigned PeelCount, LoopInfo *LI, ScalarEvolution *SE, DominatorTree *DT, AssumptionCache *AC, OptimizationRemarkEmitter *ORE, bool PreserveLCSSA)
Unroll the given loop by Count.
Definition: LoopUnroll.cpp:245
SmallDenseMap< const Loop *, Loop *, 4 > NewLoopsMap
Definition: UnrollLoop.h:34
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree...
Definition: Dominators.h:96
LLVM Basic Block Representation.
Definition: BasicBlock.h:51
const Loop * addClonedBlockToLoopInfo(BasicBlock *OriginalBB, BasicBlock *ClonedBB, LoopInfo *LI, NewLoopsMap &NewLoops)
Adds ClonedBB to LoopInfo, creates a new loop for ClonedBB if necessary and adds a mapping from the o...
Definition: LoopUnroll.cpp:179
bool peelLoop(Loop *L, unsigned PeelCount, LoopInfo *LI, ScalarEvolution *SE, DominatorTree *DT, bool PreserveLCSSA)
Peel off the first PeelCount iterations of loop L.
MDNode * GetUnrollMetadata(MDNode *LoopID, StringRef Name)
Given an llvm.loop loop id metadata node, returns the loop hint metadata node with the given name (fo...
Definition: LoopUnroll.cpp:760
bool UnrollRuntimeLoopRemainder(Loop *L, unsigned Count, bool AllowExpensiveTripCount, bool UseEpilogRemainder, LoopInfo *LI, ScalarEvolution *SE, DominatorTree *DT, bool PreserveLCSSA)
Insert code in the prolog/epilog code when unrolling a loop with a run-time trip-count.
Represents a single loop in the control flow graph.
Definition: LoopInfo.h:368
Parameters that control the generic loop unrolling transformation.
void computePeelCount(Loop *L, unsigned LoopSize, TargetTransformInfo::UnrollingPreferences &UP)
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:47
This pass exposes codegen information to IR-level passes.
The optimization diagnostic interface.