LLVM  7.0.0
LoopRotationUtils.h
Go to the documentation of this file.
1 //===- LoopRotationUtils.h - Utilities to perform loop rotation -*- 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 provides utilities to convert a loop into a loop with bottom test.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_TRANSFORMS_UTILS_LOOPROTATIONUTILS_H
15 #define LLVM_TRANSFORMS_UTILS_LOOPROTATIONUTILS_H
16 
17 namespace llvm {
18 
19 class AssumptionCache;
20 class DominatorTree;
21 class Loop;
22 class LoopInfo;
23 class ScalarEvolution;
24 struct SimplifyQuery;
25 class TargetTransformInfo;
26 
27 /// Convert a loop into a loop with bottom test. It may
28 /// perform loop latch simplication as well if the flag RotationOnly
29 /// is false. The flag Threshold represents the size threshold of the loop
30 /// header. If the loop header's size exceeds the threshold, the loop rotation
31 /// will give up. The flag IsUtilMode controls the heuristic used in the
32 /// LoopRotation. If it is true, the profitability heuristic will be ignored.
33 bool LoopRotation(Loop *L, LoopInfo *LI, const TargetTransformInfo *TTI,
34  AssumptionCache *AC, DominatorTree *DT, ScalarEvolution *SE,
35  const SimplifyQuery &SQ, bool RotationOnly,
36  unsigned Threshold, bool IsUtilMode);
37 
38 } // namespace llvm
39 
40 #endif
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
bool LoopRotation(Loop *L, LoopInfo *LI, const TargetTransformInfo *TTI, AssumptionCache *AC, DominatorTree *DT, ScalarEvolution *SE, const SimplifyQuery &SQ, bool RotationOnly, unsigned Threshold, bool IsUtilMode)
Convert a loop into a loop with bottom test.
static int const Threshold
TODO: Write a new FunctionPass AliasAnalysis so that it can keep a cache.