LLVM  14.0.0git
LoopPeel.h
Go to the documentation of this file.
1 //===- llvm/Transforms/Utils/LoopPeel.h ----- Peeling utilities -*- 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 defines some loop peeling utilities. It does not define any
10 // actual pass or policy.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_TRANSFORMS_UTILS_LOOPPEEL_H
15 #define LLVM_TRANSFORMS_UTILS_LOOPPEEL_H
16 
18 
19 namespace llvm {
20 
21 bool canPeel(Loop *L);
22 
23 bool peelLoop(Loop *L, unsigned PeelCount, LoopInfo *LI, ScalarEvolution *SE,
24  DominatorTree *DT, AssumptionCache *AC, bool PreserveLCSSA);
25 
26 TargetTransformInfo::PeelingPreferences
27 gatherPeelingPreferences(Loop *L, ScalarEvolution &SE,
28  const TargetTransformInfo &TTI,
29  Optional<bool> UserAllowPeeling,
30  Optional<bool> UserAllowProfileBasedPeeling,
31  bool UnrollingSpecficValues = false);
32 
33 void computePeelCount(Loop *L, unsigned LoopSize,
34  TargetTransformInfo::PeelingPreferences &PP,
35  unsigned &TripCount, DominatorTree &DT,
36  ScalarEvolution &SE, unsigned Threshold = UINT_MAX);
37 
38 } // end namespace llvm
39 
40 #endif // LLVM_TRANSFORMS_UTILS_LOOPPEEL_H
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
llvm::peelLoop
bool peelLoop(Loop *L, unsigned PeelCount, LoopInfo *LI, ScalarEvolution *SE, DominatorTree *DT, AssumptionCache *AC, bool PreserveLCSSA)
Peel off the first PeelCount iterations of loop L.
Definition: LoopPeel.cpp:714
llvm::computePeelCount
void computePeelCount(Loop *L, unsigned LoopSize, TargetTransformInfo::PeelingPreferences &PP, unsigned &TripCount, DominatorTree &DT, ScalarEvolution &SE, unsigned Threshold=UINT_MAX)
Definition: LoopPeel.cpp:337
llvm::canPeel
bool canPeel(Loop *L)
Definition: LoopPeel.cpp:80
llvm::TTI
TargetTransformInfo TTI
Definition: TargetTransformInfo.h:164
TargetTransformInfo.h
Threshold
static cl::opt< unsigned > Threshold("loop-unswitch-threshold", cl::desc("Max loop size to unswitch"), cl::init(100), cl::Hidden)
llvm::gatherPeelingPreferences
TargetTransformInfo::PeelingPreferences gatherPeelingPreferences(Loop *L, ScalarEvolution &SE, const TargetTransformInfo &TTI, Optional< bool > UserAllowPeeling, Optional< bool > UserAllowProfileBasedPeeling, bool UnrollingSpecficValues=false)
Definition: LoopPeel.cpp:671