1 //===- LoopRotationUtils.h - Utilities to perform loop rotation -*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
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
18 class AssumptionCache
;
22 class MemorySSAUpdater
;
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 MemorySSAUpdater
*MSSAU
, const SimplifyQuery
&SQ
,
36 bool RotationOnly
, unsigned Threshold
, bool IsUtilMode
);