17 return all_of(Def->users(),
18 [Def](
const VPUser *U) { return U->onlyFirstLaneUsed(Def); });
22 return all_of(Def->users(),
23 [Def](
const VPUser *U) { return U->onlyFirstPartUsed(Def); });
31 if (
auto *E = dyn_cast<SCEVConstant>(Expr))
33 else if (
auto *E = dyn_cast<SCEVUnknown>(Expr))
44 if (isa<VPActiveLaneMaskPHIRecipe>(V))
47 auto IsWideCanonicalIV = [](
VPValue *
A) {
48 return isa<VPWidenCanonicalIVRecipe>(
A) ||
49 (isa<VPWidenIntOrFpInductionRecipe>(
A) &&
50 cast<VPWidenIntOrFpInductionRecipe>(
A)->isCanonical());
54 using namespace VPlanPatternMatch;
56 if (
match(V, m_ActiveLaneMask(m_VPValue(
A), m_VPValue(
B))))
59 IsWideCanonicalIV(
A));
61 return match(V, m_Binary<Instruction::ICmp>(m_VPValue(
A), m_VPValue(
B))) &&
67 return SE.
getSCEV(V->getLiveInIRValue());
77 using namespace VPlanPatternMatch;
83 if (R && V->isDefinedOutsideLoopRegions()) {
84 if (
match(V->getDefiningRecipe(),
85 m_VPInstruction<VPInstruction::CanonicalIVIncrementForPart>(
88 return all_of(R->operands(),
89 [](
VPValue *
Op) { return isUniformAcrossVFsAndUFs(Op); });
92 auto *CanonicalIV = R->getParent()->getPlan()->getCanonicalIV();
94 if (V == CanonicalIV || V == CanonicalIV->getBackedgeValue())
99 .Case<VPReplicateRecipe>([](
const auto *R) {
104 return R->isUniform() &&
105 (isa<LoadInst, StoreInst>(R->getUnderlyingValue())) &&
109 .Case<VPScalarCastRecipe, VPWidenCastRecipe>([](
const auto *R) {
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
This file implements the TypeSwitch template, which mimics a switch() statement whose cases are type ...
This class represents an Operation in the Expression.
This class represents an analyzed expression in the program.
The main scalar evolution driver.
const SCEV * getSCEV(Value *V)
Return a SCEV expression for the full generality of the specified expression.
const SCEV * getCouldNotCompute()
This class implements a switch-like dispatch statement for a value of 'T' using dyn_cast functionalit...
TypeSwitch< T, ResultT > & Case(CallableT &&caseFn)
Add a case on the given type.
void appendRecipe(VPRecipeBase *Recipe)
Augment the existing recipes of a VPBasicBlock with an additional Recipe as the last recipe.
A recipe for converting the input value IV value to the corresponding value of an IV with different s...
Recipe to expand a SCEV expression.
VPRecipeBase is a base class modeling a sequence of one or more output IR instructions.
This class augments VPValue with operands which provide the inverse def-use edges from VPValue's user...
VPRecipeBase * getDefiningRecipe()
Returns the recipe defining this VPValue or nullptr if it is not defined by a recipe,...
VPlan models a candidate for vectorization, encoding various decisions take to produce efficient outp...
VPBasicBlock * getEntry()
VPValue * getTripCount() const
The trip count of the original loop.
VPValue * getOrCreateBackedgeTakenCount()
The backedge taken count of the original loop.
void addSCEVExpansion(const SCEV *S, VPValue *V)
VPValue * getOrAddLiveIn(Value *V)
Gets the live-in VPValue for V or adds a new live-in (if none exists yet) for V.
VPValue * getSCEVExpansion(const SCEV *S) const
specific_intval< false > m_SpecificInt(const APInt &V)
Match a specific integer value or vector with all elements equal to the value.
bool match(Val *V, const Pattern &P)
VPValue * getOrCreateVPValueForSCEVExpr(VPlan &Plan, const SCEV *Expr, ScalarEvolution &SE)
Get or create a VPValue that corresponds to the expansion of Expr.
bool isUniformAcrossVFsAndUFs(VPValue *V)
Checks if V is uniform across all VF lanes and UF parts.
bool onlyFirstPartUsed(const VPValue *Def)
Returns true if only the first part of Def is used.
const SCEV * getSCEVExprForVPValue(VPValue *V, ScalarEvolution &SE)
Return the SCEV expression for V.
bool onlyFirstLaneUsed(const VPValue *Def)
Returns true if only the first lane of Def is used.
bool isHeaderMask(const VPValue *V, VPlan &Plan)
Return true if V is a header mask in Plan.
This is an optimization pass for GlobalISel generic memory operations.
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly.
DWARFExpression::Operation Op