# Changeset View

Changeset View

# Standalone View

Standalone View

# llvm/trunk/include/llvm/Analysis/TargetTransformInfo.h

Show First 20 Lines • Show All 1047 Lines • ▼ Show 20 Line(s) | 81 | public: | |||
---|---|---|---|---|---|

1048 | /// \returns True if the target wants to handle the given reduction idiom in | 1048 | /// \returns True if the target wants to handle the given reduction idiom in | ||

1049 | /// the intrinsics form instead of the shuffle form. | 1049 | /// the intrinsics form instead of the shuffle form. | ||

1050 | bool useReductionIntrinsic(unsigned Opcode, Type *Ty, | 1050 | bool useReductionIntrinsic(unsigned Opcode, Type *Ty, | ||

1051 | ReductionFlags Flags) const; | 1051 | ReductionFlags Flags) const; | ||

1052 | 1052 | | |||

1053 | /// \returns True if the target wants to expand the given reduction intrinsic | 1053 | /// \returns True if the target wants to expand the given reduction intrinsic | ||

1054 | /// into a shuffle sequence. | 1054 | /// into a shuffle sequence. | ||

1055 | bool shouldExpandReduction(const IntrinsicInst *II) const; | 1055 | bool shouldExpandReduction(const IntrinsicInst *II) const; | ||

1056 | | ||||

1057 | /// \returns the size cost of rematerializing a GlobalValue address relative | ||||

1058 | /// to a stack reload. | ||||

1059 | unsigned getGISelRematGlobalCost() const; | ||||

1060 | | ||||

1056 | /// @} | 1061 | /// @} | ||

1057 | 1062 | | |||

1058 | private: | 1063 | private: | ||

1059 | /// Estimate the latency of specified instruction. | 1064 | /// Estimate the latency of specified instruction. | ||

1060 | /// Returns 1 as the default value. | 1065 | /// Returns 1 as the default value. | ||

1061 | int getInstructionLatency(const Instruction *I) const; | 1066 | int getInstructionLatency(const Instruction *I) const; | ||

1062 | 1067 | | |||

1063 | /// Returns the expected throughput cost of the instruction. | 1068 | /// Returns the expected throughput cost of the instruction. | ||

▲ Show 20 Lines • Show All 200 Lines • ▼ Show 20 Line(s) | 1268 | virtual unsigned getLoadVectorFactor(unsigned VF, unsigned LoadSize, | |||

1264 | unsigned ChainSizeInBytes, | 1269 | unsigned ChainSizeInBytes, | ||

1265 | VectorType *VecTy) const = 0; | 1270 | VectorType *VecTy) const = 0; | ||

1266 | virtual unsigned getStoreVectorFactor(unsigned VF, unsigned StoreSize, | 1271 | virtual unsigned getStoreVectorFactor(unsigned VF, unsigned StoreSize, | ||

1267 | unsigned ChainSizeInBytes, | 1272 | unsigned ChainSizeInBytes, | ||

1268 | VectorType *VecTy) const = 0; | 1273 | VectorType *VecTy) const = 0; | ||

1269 | virtual bool useReductionIntrinsic(unsigned Opcode, Type *Ty, | 1274 | virtual bool useReductionIntrinsic(unsigned Opcode, Type *Ty, | ||

1270 | ReductionFlags) const = 0; | 1275 | ReductionFlags) const = 0; | ||

1271 | virtual bool shouldExpandReduction(const IntrinsicInst *II) const = 0; | 1276 | virtual bool shouldExpandReduction(const IntrinsicInst *II) const = 0; | ||

1277 | virtual unsigned getGISelRematGlobalCost() const = 0; | ||||

1272 | virtual int getInstructionLatency(const Instruction *I) = 0; | 1278 | virtual int getInstructionLatency(const Instruction *I) = 0; | ||

1273 | }; | 1279 | }; | ||

1274 | 1280 | | |||

1275 | template <typename T> | 1281 | template <typename T> | ||

1276 | class TargetTransformInfo::Model final : public TargetTransformInfo::Concept { | 1282 | class TargetTransformInfo::Model final : public TargetTransformInfo::Concept { | ||

1277 | T Impl; | 1283 | T Impl; | ||

1278 | 1284 | | |||

1279 | public: | 1285 | public: | ||

▲ Show 20 Lines • Show All 416 Lines • ▼ Show 20 Line(s) | |||||

1696 | } | 1702 | } | ||

1697 | bool useReductionIntrinsic(unsigned Opcode, Type *Ty, | 1703 | bool useReductionIntrinsic(unsigned Opcode, Type *Ty, | ||

1698 | ReductionFlags Flags) const override { | 1704 | ReductionFlags Flags) const override { | ||

1699 | return Impl.useReductionIntrinsic(Opcode, Ty, Flags); | 1705 | return Impl.useReductionIntrinsic(Opcode, Ty, Flags); | ||

1700 | } | 1706 | } | ||

1701 | bool shouldExpandReduction(const IntrinsicInst *II) const override { | 1707 | bool shouldExpandReduction(const IntrinsicInst *II) const override { | ||

1702 | return Impl.shouldExpandReduction(II); | 1708 | return Impl.shouldExpandReduction(II); | ||

1703 | } | 1709 | } | ||

1710 | | ||||

1711 | unsigned getGISelRematGlobalCost() const override { | ||||

1712 | return Impl.getGISelRematGlobalCost(); | ||||

1713 | } | ||||

1714 | | ||||

1704 | int getInstructionLatency(const Instruction *I) override { | 1715 | int getInstructionLatency(const Instruction *I) override { | ||

1705 | return Impl.getInstructionLatency(I); | 1716 | return Impl.getInstructionLatency(I); | ||

1706 | } | 1717 | } | ||

1707 | }; | 1718 | }; | ||

1708 | 1719 | | |||

1709 | template <typename T> | 1720 | template <typename T> | ||

1710 | TargetTransformInfo::TargetTransformInfo(T Impl) | 1721 | TargetTransformInfo::TargetTransformInfo(T Impl) | ||

1711 | : TTIImpl(new Model<T>(Impl)) {} | 1722 | : TTIImpl(new Model<T>(Impl)) {} | ||

▲ Show 20 Lines • Show All 97 Lines • Show Last 20 Lines |