LLVM 20.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
20namespace llvm {
21
22bool 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.
26bool peelLoop(Loop *L, unsigned PeelCount, LoopInfo *LI, ScalarEvolution *SE,
27 DominatorTree &DT, AssumptionCache *AC, bool PreserveLCSSA,
28 ValueToValueMapTy &VMap);
29
30TargetTransformInfo::PeelingPreferences
31gatherPeelingPreferences(Loop *L, ScalarEvolution &SE,
32 const TargetTransformInfo &TTI,
33 std::optional<bool> UserAllowPeeling,
34 std::optional<bool> UserAllowProfileBasedPeeling,
35 bool UnrollingSpecficValues = false);
36
37void 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
This pass exposes codegen information to IR-level passes.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
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:538
bool canPeel(const Loop *L)
Definition: LoopPeel.cpp:83
TargetTransformInfo::PeelingPreferences gatherPeelingPreferences(Loop *L, ScalarEvolution &SE, const TargetTransformInfo &TTI, std::optional< bool > UserAllowPeeling, std::optional< bool > UserAllowProfileBasedPeeling, bool UnrollingSpecficValues=false)
Definition: LoopPeel.cpp:872
TargetTransformInfo TTI
ValueMap< const Value *, WeakTrackingVH > ValueToValueMapTy
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:916