[Alignment][NFC] Migrate Instructions to Align
[llvm-core.git] / include / llvm / Transforms / Utils / LoopRotationUtils.h
blob1e80722ed8b8d12f8ae58a636c3f1c38b5bcc866
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.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_TRANSFORMS_UTILS_LOOPROTATIONUTILS_H
14 #define LLVM_TRANSFORMS_UTILS_LOOPROTATIONUTILS_H
16 namespace llvm {
18 class AssumptionCache;
19 class DominatorTree;
20 class Loop;
21 class LoopInfo;
22 class MemorySSAUpdater;
23 class ScalarEvolution;
24 struct SimplifyQuery;
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 MemorySSAUpdater *MSSAU, const SimplifyQuery &SQ,
36 bool RotationOnly, unsigned Threshold, bool IsUtilMode);
38 } // namespace llvm
40 #endif