LLVM  10.0.0svn
LoopRotationUtils.h
Go to the documentation of this file.
1 //===- LoopRotationUtils.h - Utilities to perform loop rotation -*- 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 // This file provides utilities to convert a loop into a loop with bottom test.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_TRANSFORMS_UTILS_LOOPROTATIONUTILS_H
14 #define LLVM_TRANSFORMS_UTILS_LOOPROTATIONUTILS_H
15 
16 namespace llvm {
17 
18 class AssumptionCache;
19 class DominatorTree;
20 class Loop;
21 class LoopInfo;
22 class MemorySSAUpdater;
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  MemorySSAUpdater *MSSAU, const SimplifyQuery &SQ,
36  bool RotationOnly, unsigned Threshold, bool IsUtilMode);
37 
38 } // namespace llvm
39 
40 #endif
This class represents lattice values for constants.
Definition: AllocatorList.h:23
bool LoopRotation(Loop *L, LoopInfo *LI, const TargetTransformInfo *TTI, AssumptionCache *AC, DominatorTree *DT, ScalarEvolution *SE, MemorySSAUpdater *MSSAU, const SimplifyQuery &SQ, bool RotationOnly, unsigned Threshold, bool IsUtilMode)
Convert a loop into a loop with bottom test.
static cl::opt< unsigned > Threshold("loop-unswitch-threshold", cl::desc("Max loop size to unswitch"), cl::init(100), cl::Hidden)