Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/include/llvm/Analysis/TargetTransformInfo.h
Show First 20 Lines • Show All 539 Lines • ▼ Show 20 Lines | public: | ||||
/// vector loop, which can avoid the need to emit a scalar epilogue loop. | /// vector loop, which can avoid the need to emit a scalar epilogue loop. | ||||
bool preferPredicateOverEpilogue(Loop *L, LoopInfo *LI, ScalarEvolution &SE, | bool preferPredicateOverEpilogue(Loop *L, LoopInfo *LI, ScalarEvolution &SE, | ||||
AssumptionCache &AC, TargetLibraryInfo *TLI, | AssumptionCache &AC, TargetLibraryInfo *TLI, | ||||
DominatorTree *DT, | DominatorTree *DT, | ||||
LoopVectorizationLegality *LVL, | LoopVectorizationLegality *LVL, | ||||
InterleavedAccessInfo *IAI) const; | InterleavedAccessInfo *IAI) const; | ||||
/// Query the target what the preferred style of tail folding is. | /// Query the target what the preferred style of tail folding is. | ||||
TailFoldingStyle getPreferredTailFoldingStyle() const; | /// \param IVUpdateMayOverflow Tells whether it is known if the IV update | ||||
/// may (or will never) overflow for the suggested VF/UF in the given loop. | |||||
/// Targets can use this information to select a more optimal tail folding | |||||
/// style. The value conservatively defaults to true, such that no assumptions | |||||
/// are made on overflow. | |||||
TailFoldingStyle | |||||
getPreferredTailFoldingStyle(bool IVUpdateMayOverflow = true) const; | |||||
// Parameters that control the loop peeling transformation | // Parameters that control the loop peeling transformation | ||||
struct PeelingPreferences { | struct PeelingPreferences { | ||||
/// A forced peeling factor (the number of bodied of the original loop | /// A forced peeling factor (the number of bodied of the original loop | ||||
/// that should be peeled off before the loop body). When set to 0, the | /// that should be peeled off before the loop body). When set to 0, the | ||||
/// a peeling factor based on profile information and other factors. | /// a peeling factor based on profile information and other factors. | ||||
unsigned PeelCount; | unsigned PeelCount; | ||||
/// Allow peeling off loop iterations. | /// Allow peeling off loop iterations. | ||||
▲ Show 20 Lines • Show All 1,088 Lines • ▼ Show 20 Lines | virtual bool isHardwareLoopProfitable(Loop *L, ScalarEvolution &SE, | ||||
AssumptionCache &AC, | AssumptionCache &AC, | ||||
TargetLibraryInfo *LibInfo, | TargetLibraryInfo *LibInfo, | ||||
HardwareLoopInfo &HWLoopInfo) = 0; | HardwareLoopInfo &HWLoopInfo) = 0; | ||||
virtual bool | virtual bool | ||||
preferPredicateOverEpilogue(Loop *L, LoopInfo *LI, ScalarEvolution &SE, | preferPredicateOverEpilogue(Loop *L, LoopInfo *LI, ScalarEvolution &SE, | ||||
AssumptionCache &AC, TargetLibraryInfo *TLI, | AssumptionCache &AC, TargetLibraryInfo *TLI, | ||||
DominatorTree *DT, LoopVectorizationLegality *LVL, | DominatorTree *DT, LoopVectorizationLegality *LVL, | ||||
InterleavedAccessInfo *IAI) = 0; | InterleavedAccessInfo *IAI) = 0; | ||||
virtual TailFoldingStyle getPreferredTailFoldingStyle() = 0; | virtual TailFoldingStyle | ||||
getPreferredTailFoldingStyle(bool IVUpdateMayOverflow = true) = 0; | |||||
virtual std::optional<Instruction *> instCombineIntrinsic( | virtual std::optional<Instruction *> instCombineIntrinsic( | ||||
InstCombiner &IC, IntrinsicInst &II) = 0; | InstCombiner &IC, IntrinsicInst &II) = 0; | ||||
virtual std::optional<Value *> simplifyDemandedUseBitsIntrinsic( | virtual std::optional<Value *> simplifyDemandedUseBitsIntrinsic( | ||||
InstCombiner &IC, IntrinsicInst &II, APInt DemandedMask, | InstCombiner &IC, IntrinsicInst &II, APInt DemandedMask, | ||||
KnownBits & Known, bool &KnownBitsComputed) = 0; | KnownBits & Known, bool &KnownBitsComputed) = 0; | ||||
virtual std::optional<Value *> simplifyDemandedVectorEltsIntrinsic( | virtual std::optional<Value *> simplifyDemandedVectorEltsIntrinsic( | ||||
InstCombiner &IC, IntrinsicInst &II, APInt DemandedElts, | InstCombiner &IC, IntrinsicInst &II, APInt DemandedElts, | ||||
APInt &UndefElts, APInt &UndefElts2, APInt &UndefElts3, | APInt &UndefElts, APInt &UndefElts2, APInt &UndefElts3, | ||||
▲ Show 20 Lines • Show All 384 Lines • ▼ Show 20 Lines | public: | ||||
} | } | ||||
bool preferPredicateOverEpilogue(Loop *L, LoopInfo *LI, ScalarEvolution &SE, | bool preferPredicateOverEpilogue(Loop *L, LoopInfo *LI, ScalarEvolution &SE, | ||||
AssumptionCache &AC, TargetLibraryInfo *TLI, | AssumptionCache &AC, TargetLibraryInfo *TLI, | ||||
DominatorTree *DT, | DominatorTree *DT, | ||||
LoopVectorizationLegality *LVL, | LoopVectorizationLegality *LVL, | ||||
InterleavedAccessInfo *IAI) override { | InterleavedAccessInfo *IAI) override { | ||||
return Impl.preferPredicateOverEpilogue(L, LI, SE, AC, TLI, DT, LVL, IAI); | return Impl.preferPredicateOverEpilogue(L, LI, SE, AC, TLI, DT, LVL, IAI); | ||||
} | } | ||||
TailFoldingStyle getPreferredTailFoldingStyle() override { | TailFoldingStyle | ||||
return Impl.getPreferredTailFoldingStyle(); | getPreferredTailFoldingStyle(bool IVUpdateMayOverflow = true) override { | ||||
return Impl.getPreferredTailFoldingStyle(IVUpdateMayOverflow); | |||||
} | } | ||||
std::optional<Instruction *> | std::optional<Instruction *> | ||||
instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) override { | instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) override { | ||||
return Impl.instCombineIntrinsic(IC, II); | return Impl.instCombineIntrinsic(IC, II); | ||||
} | } | ||||
std::optional<Value *> | std::optional<Value *> | ||||
simplifyDemandedUseBitsIntrinsic(InstCombiner &IC, IntrinsicInst &II, | simplifyDemandedUseBitsIntrinsic(InstCombiner &IC, IntrinsicInst &II, | ||||
APInt DemandedMask, KnownBits &Known, | APInt DemandedMask, KnownBits &Known, | ||||
▲ Show 20 Lines • Show All 667 Lines • Show Last 20 Lines |