1 //===- LoopRotationUtils.h - Utilities to perform loop rotation -*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file provides utilities to convert a loop into a loop with bottom test.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_TRANSFORMS_UTILS_LOOPROTATIONUTILS_H
15 #define LLVM_TRANSFORMS_UTILS_LOOPROTATIONUTILS_H
19 class AssumptionCache;
23 class ScalarEvolution;
25 class TargetTransformInfo;
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);