9#ifndef LLVM_TRANSFORMS_VECTORIZE_VPRECIPEBUILDER_H
10#define LLVM_TRANSFORMS_VECTORIZE_VPRECIPEBUILDER_H
92 : Plan(Plan), TLI(TLI), Legal(Legal), CM(CM), Builder(Builder),
93 BlockMaskCache(BlockMaskCache) {}
102 assert(!Ingredient2Recipe.contains(
I) &&
103 "Cannot reset recipe for instruction.");
104 Ingredient2Recipe[
I] = R;
110 return BlockMaskCache.lookup(VPBB);
115 assert(Ingredient2Recipe.count(
I) &&
116 "Recording this ingredients recipe was not requested");
117 assert(Ingredient2Recipe[
I] !=
nullptr &&
118 "Ingredient doesn't have a recipe");
119 return Ingredient2Recipe[
I];
129 if (
auto *R = Ingredient2Recipe.lookup(
I))
130 return R->getVPSingleValue();
132 return Plan.getOrAddLiveIn(V);
136 for (
auto &[
_, V] : BlockMaskCache) {
137 if (
auto *New = Old2New.
lookup(V)) {
138 V->replaceAllUsesWith(New);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the DenseMap class.
This file provides a LoopVectorizationPlanner class.
ConstantRange Range(APInt(BitWidth, Low), APInt(BitWidth, High))
This file contains the declarations of the Vectorization Plan base classes:
ValueT lookup(const_arg_type_t< KeyT > Val) const
lookup - Return the entry for the specified key, or a default constructed value if no such entry exis...
LoopVectorizationCostModel - estimates the expected speedups due to vectorization.
LoopVectorizationLegality checks if it is legal to vectorize a loop, and to what vectorization factor...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Provides information about what library functions are available for the current target.
VPBasicBlock serves as the leaf of the Hierarchical Control-Flow Graph.
VPlan-based builder utility analogous to IRBuilder.
A recipe representing a sequence of load -> update -> store as part of a histogram operation.
This is a concrete Recipe that models a single VPlan-level instruction.
VPRecipeBase is a base class modeling a sequence of one or more output IR instructions.
VPValue * getBlockInMask(VPBasicBlock *VPBB) const
Returns the entry mask for block VPBB or null if the mask is all-true.
VPRecipeBase * tryToCreateWidenNonPhiRecipe(VPSingleDefRecipe *R, VFRange &Range)
Create and return a widened recipe for a non-phi recipe R if one can be created within the given VF R...
VPValue * getVPValueOrAddLiveIn(Value *V)
VPRecipeBuilder(VPlan &Plan, const TargetLibraryInfo *TLI, LoopVectorizationLegality *Legal, LoopVectorizationCostModel &CM, VPBuilder &Builder, DenseMap< VPBasicBlock *, VPValue * > &BlockMaskCache)
void setRecipe(Instruction *I, VPRecipeBase *R)
Set the recipe created for given ingredient.
VPReplicateRecipe * handleReplication(VPInstruction *VPI, VFRange &Range)
Build a VPReplicationRecipe for VPI.
VPRecipeBase * getRecipe(Instruction *I)
Return the recipe created for given ingredient.
void updateBlockMaskCache(DenseMap< VPValue *, VPValue * > &Old2New)
VPReplicateRecipe replicates a given instruction producing multiple scalar copies of the original sca...
VPSingleDef is a base class for recipes for modeling a sequence of one or more output IR that define ...
This is the base class of the VPlan Def/Use graph, used for modeling the data flow into,...
A recipe for handling phi nodes of integer and floating-point inductions, producing their vector valu...
VPWidenRecipe is a recipe for producing a widened instruction using the opcode and operands of the re...
VPlan models a candidate for vectorization, encoding various decisions take to produce efficient outp...
LLVM Value Representation.
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
This holds details about a histogram operation – a load -> update -> store sequence where each lane i...
A range of powers-of-2 vectorization factors with fixed start and adjustable end.