Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:43

0001 //===- llvm/Transforms/Utils/LoopPeel.h ----- Peeling utilities -*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // This file defines some loop peeling utilities. It does not define any
0010 // actual pass or policy.
0011 //
0012 //===----------------------------------------------------------------------===//
0013 
0014 #ifndef LLVM_TRANSFORMS_UTILS_LOOPPEEL_H
0015 #define LLVM_TRANSFORMS_UTILS_LOOPPEEL_H
0016 
0017 #include "llvm/Analysis/TargetTransformInfo.h"
0018 #include "llvm/Transforms/Utils/ValueMapper.h"
0019 
0020 namespace llvm {
0021 
0022 bool canPeel(const Loop *L);
0023 
0024 /// VMap is the value-map that maps instructions from the original loop to
0025 /// instructions in the last peeled-off iteration.
0026 bool peelLoop(Loop *L, unsigned PeelCount, LoopInfo *LI, ScalarEvolution *SE,
0027               DominatorTree &DT, AssumptionCache *AC, bool PreserveLCSSA,
0028               ValueToValueMapTy &VMap);
0029 
0030 TargetTransformInfo::PeelingPreferences
0031 gatherPeelingPreferences(Loop *L, ScalarEvolution &SE,
0032                          const TargetTransformInfo &TTI,
0033                          std::optional<bool> UserAllowPeeling,
0034                          std::optional<bool> UserAllowProfileBasedPeeling,
0035                          bool UnrollingSpecficValues = false);
0036 
0037 void computePeelCount(Loop *L, unsigned LoopSize,
0038                       TargetTransformInfo::PeelingPreferences &PP,
0039                       unsigned TripCount, DominatorTree &DT,
0040                       ScalarEvolution &SE, AssumptionCache *AC = nullptr,
0041                       unsigned Threshold = UINT_MAX);
0042 
0043 } // end namespace llvm
0044 
0045 #endif // LLVM_TRANSFORMS_UTILS_LOOPPEEL_H