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 MemorySSAUpdater;
24 class ScalarEvolution;
26 class TargetTransformInfo;
28 /// Convert a loop into a loop with bottom test. It may
29 /// perform loop latch simplication as well if the flag RotationOnly
30 /// is false. The flag Threshold represents the size threshold of the loop
31 /// header. If the loop header's size exceeds the threshold, the loop rotation
32 /// will give up. The flag IsUtilMode controls the heuristic used in the
33 /// LoopRotation. If it is true, the profitability heuristic will be ignored.
34 bool LoopRotation(Loop *L, LoopInfo *LI, const TargetTransformInfo *TTI,
35 AssumptionCache *AC, DominatorTree *DT, ScalarEvolution *SE,
36 MemorySSAUpdater *MSSAU, const SimplifyQuery &SQ,
37 bool RotationOnly, unsigned Threshold, bool IsUtilMode);