003 File Manager
Current Path:
/usr/src/contrib/llvm-project/llvm/include/llvm/Transforms/Scalar
usr
/
src
/
contrib
/
llvm-project
/
llvm
/
include
/
llvm
/
Transforms
/
Scalar
/
📁
..
📄
ADCE.h
(1.38 KB)
📄
AlignmentFromAssumptions.h
(1.6 KB)
📄
BDCE.h
(1.04 KB)
📄
CallSiteSplitting.h
(810 B)
📄
ConstantHoisting.h
(8.02 KB)
📄
CorrelatedValuePropagation.h
(810 B)
📄
DCE.h
(892 B)
📄
DeadStoreElimination.h
(1.2 KB)
📄
DivRemPairs.h
(1.01 KB)
📄
EarlyCSE.h
(1.41 KB)
📄
Float2Int.h
(1.74 KB)
📄
GVN.h
(12.57 KB)
📄
GVNExpression.h
(20.21 KB)
📄
GuardWidening.h
(1.18 KB)
📄
IVUsersPrinter.h
(960 B)
📄
IndVarSimplify.h
(1.03 KB)
📄
InductiveRangeCheckElimination.h
(950 B)
📄
InstSimplifyPass.h
(1.64 KB)
📄
JumpThreading.h
(6.55 KB)
📄
LICM.h
(2.78 KB)
📄
LoopAccessAnalysisPrinter.h
(999 B)
📄
LoopDataPrefetch.h
(1.06 KB)
📄
LoopDeletion.h
(1.13 KB)
📄
LoopDistribute.h
(1.08 KB)
📄
LoopFuse.h
(876 B)
📄
LoopIdiomRecognize.h
(1.18 KB)
📄
LoopInstSimplify.h
(1.07 KB)
📄
LoopLoadElimination.h
(1.1 KB)
📄
LoopPassManager.h
(15.85 KB)
📄
LoopPredication.h
(1.12 KB)
📄
LoopRotation.h
(1.13 KB)
📄
LoopSimplifyCFG.h
(1.31 KB)
📄
LoopSink.h
(1.54 KB)
📄
LoopStrengthReduce.h
(1.52 KB)
📄
LoopUnrollAndJamPass.h
(921 B)
📄
LoopUnrollPass.h
(4.97 KB)
📄
LowerAtomic.h
(974 B)
📄
LowerConstantIntrinsics.h
(1.4 KB)
📄
LowerExpectIntrinsic.h
(1.25 KB)
📄
LowerGuardIntrinsic.h
(992 B)
📄
LowerMatrixIntrinsics.h
(868 B)
📄
LowerWidenableCondition.h
(937 B)
📄
MakeGuardsExplicit.h
(1.85 KB)
📄
MemCpyOptimizer.h
(2.71 KB)
📄
MergeICmps.h
(714 B)
📄
MergedLoadStoreMotion.h
(2.02 KB)
📄
NaryReassociate.h
(6.98 KB)
📄
NewGVN.h
(935 B)
📄
PartiallyInlineLibCalls.h
(1.04 KB)
📄
Reassociate.h
(4.6 KB)
📄
RewriteStatepointsForGC.h
(1.27 KB)
📄
SCCP.h
(1.81 KB)
📄
SROA.h
(5.29 KB)
📄
Scalarizer.h
(1.18 KB)
📄
SimpleLoopUnswitch.h
(3.35 KB)
📄
SimplifyCFG.h
(2.01 KB)
📄
Sink.h
(998 B)
📄
SpeculateAroundPHIs.h
(3.69 KB)
📄
SpeculativeExecution.h
(3.04 KB)
📄
TailRecursionElimination.h
(3.3 KB)
📄
WarnMissedTransforms.h
(1.19 KB)
Editing: LoopUnrollPass.h
//===- LoopUnrollPass.h -----------------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef LLVM_TRANSFORMS_SCALAR_LOOPUNROLLPASS_H #define LLVM_TRANSFORMS_SCALAR_LOOPUNROLLPASS_H #include "llvm/ADT/Optional.h" #include "llvm/Analysis/LoopAnalysisManager.h" #include "llvm/IR/PassManager.h" #include "llvm/Support/CommandLine.h" namespace llvm { extern cl::opt<bool> ForgetSCEVInLoopUnroll; class Function; class Loop; class LPMUpdater; /// Loop unroll pass that only does full loop unrolling. class LoopFullUnrollPass : public PassInfoMixin<LoopFullUnrollPass> { const int OptLevel; /// If false, use a cost model to determine whether unrolling of a loop is /// profitable. If true, only loops that explicitly request unrolling via /// metadata are considered. All other loops are skipped. const bool OnlyWhenForced; /// If true, forget all loops when unrolling. If false, forget top-most loop /// of the currently processed loops, which removes one entry at a time from /// the internal SCEV records. For large loops, the former is faster. const bool ForgetSCEV; public: explicit LoopFullUnrollPass(int OptLevel = 2, bool OnlyWhenForced = false, bool ForgetSCEV = false) : OptLevel(OptLevel), OnlyWhenForced(OnlyWhenForced), ForgetSCEV(ForgetSCEV) {} PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U); }; /// A set of parameters used to control various transforms performed by the /// LoopUnroll pass. Each of the boolean parameters can be set to: /// true - enabling the transformation. /// false - disabling the transformation. /// None - relying on a global default. /// /// There is also OptLevel parameter, which is used for additional loop unroll /// tuning. /// /// Intended use is to create a default object, modify parameters with /// additional setters and then pass it to LoopUnrollPass. /// struct LoopUnrollOptions { Optional<bool> AllowPartial; Optional<bool> AllowPeeling; Optional<bool> AllowRuntime; Optional<bool> AllowUpperBound; Optional<bool> AllowProfileBasedPeeling; Optional<unsigned> FullUnrollMaxCount; int OptLevel; /// If false, use a cost model to determine whether unrolling of a loop is /// profitable. If true, only loops that explicitly request unrolling via /// metadata are considered. All other loops are skipped. bool OnlyWhenForced; /// If true, forget all loops when unrolling. If false, forget top-most loop /// of the currently processed loops, which removes one entry at a time from /// the internal SCEV records. For large loops, the former is faster. const bool ForgetSCEV; LoopUnrollOptions(int OptLevel = 2, bool OnlyWhenForced = false, bool ForgetSCEV = false) : OptLevel(OptLevel), OnlyWhenForced(OnlyWhenForced), ForgetSCEV(ForgetSCEV) {} /// Enables or disables partial unrolling. When disabled only full unrolling /// is allowed. LoopUnrollOptions &setPartial(bool Partial) { AllowPartial = Partial; return *this; } /// Enables or disables unrolling of loops with runtime trip count. LoopUnrollOptions &setRuntime(bool Runtime) { AllowRuntime = Runtime; return *this; } /// Enables or disables loop peeling. LoopUnrollOptions &setPeeling(bool Peeling) { AllowPeeling = Peeling; return *this; } /// Enables or disables the use of trip count upper bound /// in loop unrolling. LoopUnrollOptions &setUpperBound(bool UpperBound) { AllowUpperBound = UpperBound; return *this; } // Sets "optimization level" tuning parameter for loop unrolling. LoopUnrollOptions &setOptLevel(int O) { OptLevel = O; return *this; } // Enables or disables loop peeling basing on profile. LoopUnrollOptions &setProfileBasedPeeling(int O) { AllowProfileBasedPeeling = O; return *this; } // Sets the max full unroll count. LoopUnrollOptions &setFullUnrollMaxCount(unsigned O) { FullUnrollMaxCount = O; return *this; } }; /// Loop unroll pass that will support both full and partial unrolling. /// It is a function pass to have access to function and module analyses. /// It will also put loops into canonical form (simplified and LCSSA). class LoopUnrollPass : public PassInfoMixin<LoopUnrollPass> { LoopUnrollOptions UnrollOpts; public: /// This uses the target information (or flags) to control the thresholds for /// different unrolling stategies but supports all of them. explicit LoopUnrollPass(LoopUnrollOptions UnrollOpts = {}) : UnrollOpts(UnrollOpts) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); }; } // end namespace llvm #endif // LLVM_TRANSFORMS_SCALAR_LOOPUNROLLPASS_H
Upload File
Create Folder