13#ifndef LLVM_TRANSFORMS_VECTORIZE_VPLANTRANSFORMS_H
14#define LLVM_TRANSFORMS_VECTORIZE_VPLANTRANSFORMS_H
57 template <
bool EnableVerify =
true,
typename PassTy,
typename... ArgsTy>
67 std::string NumberedPassName;
70 Instance = ++PassCounter[{Fn,
PassName}];
72 NumberedPassName = Instance == 1
90 return std::forward<PassTy>(
Pass)(Plan, std::forward<ArgsTy>(Args)...);
92#define RUN_VPLAN_PASS(PASS, ...) \
93 llvm::VPlanTransforms::runPass(#PASS, PASS, __VA_ARGS__)
94#define RUN_VPLAN_PASS_NO_VERIFY(PASS, ...) \
95 llvm::VPlanTransforms::runPass<false>(#PASS, PASS, __VA_ARGS__)
140 PredicatedScalarEvolution &PSE, LoopVersioning *LVer =
nullptr,
141 function_ref<
const BranchProbabilityInfo &()> GetBPI =
nullptr);
155 VPlan &Plan, PredicatedScalarEvolution &PSE,
Loop &OrigLoop,
156 OptimizationRemarkEmitter *ORE,
const VPDominatorTree &VPDT,
157 const MapVector<PHINode *, InductionDescriptor> &Inductions,
158 const MapVector<PHINode *, RecurrenceDescriptor> &
Reductions,
159 const SmallPtrSetImpl<const PHINode *> &FixedOrderRecurrences,
160 const SmallPtrSetImpl<PHINode *> &InLoopReductions,
bool AllowReordering);
169 bool OptForSize,
unsigned SCEVCheckThreshold,
170 OptimizationRemarkEmitter *ORE,
Loop *TheLoop);
184 VPlan &Plan, ElementCount VF,
unsigned UF,
185 ElementCount MinProfitableTripCount,
bool RequiresScalarEpilogue,
187 DebugLoc DL, PredicatedScalarEvolution &PSE, VPBasicBlock *CheckBlock);
193 bool RequiresScalarEpilogue,
Loop *OrigLoop,
200 VPlan &Plan, VPValue *MainVectorTripCount,
bool RequiresScalarEpilogue,
201 ElementCount EpilogueVF,
unsigned MainLoopStep,
unsigned EpilogueLoopStep,
202 ScalarEvolution &SE);
212 VPBasicBlock *CheckBlock,
213 bool AddBranchWeights);
215 bool AddBranchWeights);
221 const RuntimePointerChecking &RtPtrChecking,
222 ScalarEvolution &SE, ElementCount VF,
224 bool AddBranchWeights);
235 VPBasicBlock *MainCheck);
242 VPlan &Plan,
const TargetLibraryInfo &TLI, PredicatedScalarEvolution &PSE,
250 OptimizationRemarkEmitter *ORE,
270 static void unrollByUF(VPlan &Plan,
unsigned UF);
283 PredicatedScalarEvolution &PSE);
288 PredicatedScalarEvolution &PSE);
309 bool UseActiveLaneMaskForControlFlow);
315 const MapVector<Instruction *, uint64_t> &MinBWs);
320 PredicatedScalarEvolution &PSE);
325 PredicatedScalarEvolution &PSE,
327 const VPDominatorTree &VPDT);
344 const std::optional<unsigned> &MaxEVLSafeElements);
360 const SmallPtrSetImpl<
const InterleaveGroup<Instruction> *>
362 const bool &EpilogueAllowed);
368 PredicatedScalarEvolution &PSE,
Loop &L,
369 VPCostContext &Ctx, VFRange &
Range);
379 PredicatedScalarEvolution &PSE,
381 AssumptionCache *AC);
395 Loop *TheLoop, PredicatedScalarEvolution &PSE,
396 DominatorTree &DT, AssumptionCache *AC,
447 static void cse(VPlan &Plan,
const VPDominatorTree &VPDT);
453 PredicatedScalarEvolution &PSE,
475 const TargetTransformInfo &
TTI);
482 PredicatedScalarEvolution &PSE);
489 VPlan &Plan, VPBasicBlock *VectorPHVPBB,
bool TailByMasking,
490 bool RequiresScalarEpilogue, VPValue *Step,
491 std::optional<uint64_t> MaxRuntimeStep = std::nullopt);
507 VPBasicBlock *AliasCheckVPBB,
524 static DenseMap<const SCEV *, Value *>
expandSCEVs(VPlan &Plan,
525 ScalarEvolution &SE);
539 static std::unique_ptr<VPlan>
586 const TargetTransformInfo &
TTI,
588 ElementCount VF,
unsigned UF);
594 std::optional<unsigned> VScaleForTuning);
609 PredicatedScalarEvolution &PSE,
Loop &L);
621 VPRecipeBuilder &RecipeBuilder,
622 VPCostContext &CostCtx);
634 VPRecipeBuilder &RecipeBuilder,
635 VPCostContext &CostCtx);
643 const TargetTransformInfo &
TTI,
644 PredicatedScalarEvolution &PSE);
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
#define LLVM_ABI_FOR_TEST
static constexpr uint32_t MinItersBypassWeights[]
ConstantRange Range(APInt(BitWidth, Low), APInt(BitWidth, High))
SmallVector< MachineOperand, 4 > Cond
This file defines the scope_exit class, which executes user-defined cleanup logic at scope exit.
This file declares the class VPlanVerifier, which contains utility functions to check the consistency...
This file contains the declarations of the Vectorization Plan base classes:
static const char PassName[]
const Function * getParent() const
Return the enclosing method, or null if none.
Analysis providing branch probability information.
A struct for saving information about induction variables.
This class emits a version of the loop where run-time checks ensure that may-alias pointers can't ove...
Represents a single loop in the control flow graph.
Pass interface - Implemented by all 'passes'.
An interface layer with SCEV used to manage how we see SCEV expressions for values in the context of ...
Holds information about the memory runtime legality checks to verify that a group of pointers do not ...
The main scalar evolution driver.
Represent a constant reference to a string, i.e.
Provides information about what library functions are available for the current target.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
BasicBlock * getIRBasicBlock() const
Helper class to create VPRecipies from IR instructions.
VPlan models a candidate for vectorization, encoding various decisions take to produce efficient outp...
VPIRBasicBlock * getScalarHeader() const
Return the VPIRBasicBlock wrapping the header of the scalar loop.
This is an optimization pass for GlobalISel generic memory operations.
DenseMap< Value *, const SCEVUnknown * > SymbolicStrideMap
Maps a pointer to its symbolic (non-constant) stride.
UncountableExitStyle
Different methods of handling early exits.
ArrayRef(const T &OneElt) -> ArrayRef< T >
A range of powers-of-2 vectorization factors with fixed start and adjustable end.