LLVM  17.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 
19 
20 namespace llvm {
21 
22 bool canPeel(const Loop *L);
23 
24 /// VMap is the value-map that maps instructions from the original loop to
25 /// instructions in the last peeled-off iteration.
26 bool peelLoop(Loop *L, unsigned PeelCount, LoopInfo *LI, ScalarEvolution *SE,
27  DominatorTree &DT, AssumptionCache *AC, bool PreserveLCSSA,
28  ValueToValueMapTy &VMap);
29 
30 TargetTransformInfo::PeelingPreferences
31 gatherPeelingPreferences(Loop *L, ScalarEvolution &SE,
32  const TargetTransformInfo &TTI,
33  std::optional<bool> UserAllowPeeling,
34  std::optional<bool> UserAllowProfileBasedPeeling,
35  bool UnrollingSpecficValues = false);
36 
37 void computePeelCount(Loop *L, unsigned LoopSize,
38  TargetTransformInfo::PeelingPreferences &PP,
39  unsigned TripCount, DominatorTree &DT,
40  ScalarEvolution &SE, AssumptionCache *AC = nullptr,
41  unsigned Threshold = UINT_MAX);
42 
43 } // end namespace llvm
44 
45 #endif // LLVM_TRANSFORMS_UTILS_LOOPPEEL_H
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
ValueMapper.h
llvm::computePeelCount
void computePeelCount(Loop *L, unsigned LoopSize, TargetTransformInfo::PeelingPreferences &PP, unsigned TripCount, DominatorTree &DT, ScalarEvolution &SE, AssumptionCache *AC=nullptr, unsigned Threshold=UINT_MAX)
Definition: LoopPeel.cpp:472
llvm::canPeel
bool canPeel(const Loop *L)
Definition: LoopPeel.cpp:83
llvm::peelLoop
bool peelLoop(Loop *L, unsigned PeelCount, LoopInfo *LI, ScalarEvolution *SE, DominatorTree &DT, AssumptionCache *AC, bool PreserveLCSSA, ValueToValueMapTy &VMap)
VMap is the value-map that maps instructions from the original loop to instructions in the last peele...
Definition: LoopPeel.cpp:855
llvm::ValueToValueMapTy
ValueMap< const Value *, WeakTrackingVH > ValueToValueMapTy
Definition: MemorySSAUpdater.h:50
llvm::TTI
TargetTransformInfo TTI
Definition: TargetTransformInfo.h:167
llvm::gatherPeelingPreferences
TargetTransformInfo::PeelingPreferences gatherPeelingPreferences(Loop *L, ScalarEvolution &SE, const TargetTransformInfo &TTI, std::optional< bool > UserAllowPeeling, std::optional< bool > UserAllowProfileBasedPeeling, bool UnrollingSpecficValues=false)
Definition: LoopPeel.cpp:811
TargetTransformInfo.h