Lines Matching defs:Legal

491         Builder(PSE.getSE()->getContext()), Legal(LVL), Cost(CM), BFI(BFI),
659 LoopVectorizationLegality *Legal;
982 LoopVectorizationLegality *Legal,
989 : ScalarEpilogueStatus(SEL), TheLoop(L), PSE(PSE), LI(LI), Legal(Legal),
1251 if (Op != Legal->getPrimaryInduction() && TTI.isTruncateFree(SrcTy, DestTy))
1255 return Legal->isInductionPhi(Op);
1281 return Legal->isConsecutivePtr(DataType, Ptr) &&
1288 return Legal->isConsecutivePtr(DataType, Ptr) &&
1310 return (all_of(Legal->getReductionVars(), [&](auto &Reduction) -> bool {
1381 !(EnableEarlyExitVectorization && Legal->hasUncountableEarlyExit())) {
1430 if (!Legal->canFoldTailByMasking()) {
1455 !EnableVPlanNativePath && Legal->getFixedOrderRecurrences().empty();
1493 return foldTailByMasking() || Legal->blockNeedsPredication(BB);
1768 LoopVectorizationLegality *Legal;
2326 Type *IdxTy = Cost->Legal->getWidestInductionType();
2696 Instruction *OldInduction = Legal->getPrimaryInduction();
2699 for (const auto &InductionEntry : Legal->getInductionVars()) {
3174 for (const auto &Induction : Legal->getInductionVars()) {
3180 if (Ind == Legal->getPrimaryInduction() && foldTailByMasking())
3207 if (IndUpdatePhi && Legal->isFixedOrderRecurrence(IndUpdatePhi))
3279 (isa<LoadInst, StoreInst, CallInst>(I) && !Legal->isMaskRequired(I)) ||
3285 if (Legal->blockNeedsPredication(I->getParent()))
3300 assert(Legal->isMaskRequired(I) &&
3305 return !Legal->isInvariant(getLoadStorePointerOperand(I));
3311 return !(Legal->isInvariant(getLoadStorePointerOperand(I)) &&
3376 Legal->isInvariant(Op2))
3435 Legal->isMaskRequired(I);
3470 if (!Legal->isConsecutivePtr(ScalarTy, Ptr))
3541 if (Legal->hasUncountableEarlyExit() && TheLoop->getLoopLatch() != E)
3559 if (!Legal->isUniformMemOp(*I, VF))
3589 (IsUniformDecision(I, VF) || Legal->isInvariant(Ptr));
3668 if (OP && Legal->isFixedOrderRecurrence(OP))
3688 for (const auto &Induction : Legal->getInductionVars()) {
3723 if (Legal->getRuntimePointerChecking()->Need) {
3742 if (!Legal->getLAI()->getSymbolicStrides().empty()) {
3799 if (!Legal->isSafeForAnyVectorWidth() && !getMaxVScale(*TheFunction, TTI)) {
3817 if (Legal->isSafeForAnyVectorWidth())
3844 llvm::bit_floor(Legal->getMaxSafeVectorWidthInBits() / WidestType);
3848 if (!Legal->isSafeForAnyVectorWidth())
3942 if (Legal->getRuntimePointerChecking()->Need && TTI.hasBranchDivergence()) {
3971 Legal->getWidestInductionType()->getScalarSizeInBits() &&
4200 (UseWiderVFIfCallVariantsPresent && Legal->hasVectorCallVariants())))) {
4342 VPCostContext CostCtx(CM.TTI, *CM.TLI, Legal->getWidestInductionType(),
4621 [&](PHINode &Phi) { return Legal->isFixedOrderRecurrence(&Phi); }))
4626 for (const auto &Entry : Legal->getInductionVars()) {
4729 Type *TCType = Legal->getWidestInductionType();
4793 if (ElementTypesInLoop.empty() && !Legal->getReductionVars().empty()) {
4797 for (const auto &PhiDescriptorPair : Legal->getReductionVars()) {
4836 if (!Legal->isReductionVariable(PN))
4839 Legal->getReductionVars().find(PN)->second;
4888 if (!Legal->isSafeForAnyVectorWidth())
4894 if (Legal->hasUncountableEarlyExit())
4898 const bool HasReductions = !Legal->getReductionVars().empty();
5046 return Legal->blockNeedsPredication(BB);
5049 (VF.isScalar() && Legal->getRuntimePointerChecking()->Need);
5068 unsigned NumStores = Legal->getNumStores();
5069 unsigned NumLoads = Legal->getNumLoads();
5079 any_of(Legal->getReductionVars(), [&](auto &Reduction) -> bool {
5097 any_of(Legal->getReductionVars(), [&](auto &Reduction) -> bool {
5541 addFullyUnrolledInstructionsToIgnore(TheLoop, Legal->getInductionVars(),
5572 // Legal is used so as to not include all blocks in tail folded loops.
5573 if (VF.isScalar() && Legal->blockNeedsPredication(BB))
5589 LoopVectorizationLegality *Legal,
5604 !Legal->isInductionVariable(Opd))
5631 const SCEV *PtrSCEV = getAddressAccessSCEV(Ptr, Legal, PSE, TheLoop);
5678 int ConsecutiveStride = Legal->isConsecutivePtr(ValTy, Ptr);
5684 if (Legal->isMaskRequired(I)) {
5703 assert(Legal->isUniformMemOp(*I, VF));
5718 bool IsLoopInvariantStoreValue = Legal->isInvariant(SI->getValueOperand());
5738 Legal->isMaskRequired(I), Alignment,
5768 Group->getAlign(), AS, CostKind, Legal->isMaskRequired(I),
5773 assert(!Legal->isMaskRequired(I) &&
5829 Legal->getReductionVars().find(cast<PHINode>(ReductionPhi))->second;
6042 if (Legal->isUniformMemOp(I, VF)) {
6091 int ConsecutiveStride = Legal->isConsecutivePtr(
6257 bool MaskRequired = Legal->isMaskRequired(CI);
6384 if (!Legal->isInvariant(Op))
6519 if (VF.isVector() && Legal->isFixedOrderRecurrence(Phi)) {
6548 auto &ReductionVars = Legal->getReductionVars();
6565 Legal->getReductionVars().contains(Phi) && !isInLoopReduction(Phi)) {
6587 auto Info = Legal->getHistogramInfo(I);
6759 return Legal->isMaskRequired(I) ? TTI::CastContextHint::Masked
6861 Legal->isInvariantAddressOfReduction(SI->getPointerOperand())) {
6979 for (const auto &Reduction : Legal->getReductionVars()) {
6986 for (const auto &Induction : Legal->getInductionVars()) {
6994 for (const auto &Reduction : Legal->getReductionVars()) {
7129 Legal->prepareToFoldTailByMasking();
7210 for (const auto &[IV, IndDesc] : Legal->getInductionVars()) {
7237 addFullyUnrolledInstructionsToIgnore(OrigLoop, Legal->getInductionVars(),
7296 for (const auto &[RedPhi, RdxDesc] : Legal->getReductionVars()) {
7394 VPCostContext CostCtx(CM.TTI, *CM.TLI, Legal->getWidestInductionType(), CM,
7538 VPCostContext CostCtx(CM.TTI, *CM.TLI, Legal->getWidestInductionType(), CM,
7672 Legal->getWidestInductionType());
7700 const LoopAccessInfo *LAI = ILV.Legal->getLAI();
7738 assert(!ILV.Legal->hasUncountableEarlyExit() &&
7746 for (const auto &[IVPhi, _] : Legal->getInductionVars()) {
8163 Src != Legal->getUncountableEarlyExitingBlock())
8280 if (Legal->isMaskRequired(I))
8352 if (auto *II = Legal->getIntOrFpInductionDescriptor(Phi))
8357 if (auto *II = Legal->getPointerInductionDescriptor(Phi)) {
8392 const InductionDescriptor &II = *Legal->getIntOrFpInductionDescriptor(Phi);
8500 if (Legal->isMaskRequired(CI))
8613 if (Legal->isMaskRequired(HI->Store))
8699 for (const auto &[Phi, RdxDesc] : Legal->getReductionVars()) {
8824 assert((Legal->isReductionVariable(Phi) ||
8825 Legal->isFixedOrderRecurrence(Phi)) &&
8828 if (Legal->isReductionVariable(Phi)) {
8830 Legal->getReductionVars().find(Phi)->second;
8865 if (auto HistInfo = Legal->getHistogramInfo(SI))
9243 VPlanPtr Plan = VPlan::createInitialVPlan(Legal->getWidestInductionType(),
9255 DebugLoc DL = getDebugLocFromInstOrOperands(Legal->getPrimaryInduction());
9262 addCanonicalIVRecipes(*Plan, Legal->getWidestInductionType(), HasNUW, DL);
9264 VPRecipeBuilder RecipeBuilder(*Plan, OrigLoop, TLI, &TTI, Legal, CM, PSE,
9309 return Legal->blockNeedsPredication(BB) || NeedsBlends;
9347 Legal->isInvariantAddressOfReduction(SI->getPointerOperand())) {
9349 if (!Legal->isInvariantStoreOfReduction(SI))
9397 for (const auto &[Phi, ID] : Legal->getInductionVars()) {
9409 Legal->getUncountableEarlyExitingBlock()) {
9453 for (auto [_, Stride] : Legal->getLAI()->getSymbolicStrides()) {
9482 return Legal->blockNeedsPredication(BB);
9517 auto Plan = VPlan::createInitialVPlan(Legal->getWidestInductionType(), PSE,
9529 [this](PHINode *P) { return Legal->getIntOrFpInductionDescriptor(P); },
9535 addCanonicalIVRecipes(*Plan, Legal->getWidestInductionType(), HasNUW,
9540 VPRecipeBuilder RecipeBuilder(*Plan, OrigLoop, TLI, &TTI, Legal, CM, PSE,