Changeset View
Changeset View
Standalone View
Standalone View
include/llvm/Analysis/TargetTransformInfo.h
Show First 20 Lines • Show All 360 Lines • ▼ Show 20 Lines | public: | ||||
bool shouldBuildLookupTables() const; | bool shouldBuildLookupTables() const; | ||||
/// \brief Don't restrict interleaved unrolling to small loops. | /// \brief Don't restrict interleaved unrolling to small loops. | ||||
bool enableAggressiveInterleaving(bool LoopHasReductions) const; | bool enableAggressiveInterleaving(bool LoopHasReductions) const; | ||||
/// \brief Enable matching of interleaved access groups. | /// \brief Enable matching of interleaved access groups. | ||||
bool enableInterleavedAccessVectorization() const; | bool enableInterleavedAccessVectorization() const; | ||||
/// \brief Enable matching of potentially unsafe floating point math in SIMD. | |||||
/// This mainly requires relaxation of rules regarding IEEE-754 support | |||||
/// (like sub-normals in NEON v7) via unsafe math flags. | |||||
bool enablePotentiallyUnsafeFPVectorization() const; | |||||
hfinkel: The name of this method, and the corresponding comment, seem potentially confusing (no pun… | |||||
rengolinAuthorUnsubmitted Not Done ReplyInline ActionsI see, and then invert the logic to return "false" by default, as in "it's not unsafe to transform this operation in this target", but on v7 NEON return true because it "is unsafe to do unsafe FP on NEON". I'll change that, as I really hated my original name. :) rengolin: I see, and then invert the logic to return "false" by default, as in "it's not unsafe to… | |||||
/// \brief Return hardware support for population count. | /// \brief Return hardware support for population count. | ||||
PopcntSupportKind getPopcntSupport(unsigned IntTyWidthInBit) const; | PopcntSupportKind getPopcntSupport(unsigned IntTyWidthInBit) const; | ||||
/// \brief Return true if the hardware has a fast square-root instruction. | /// \brief Return true if the hardware has a fast square-root instruction. | ||||
bool haveFastSqrt(Type *Ty) const; | bool haveFastSqrt(Type *Ty) const; | ||||
/// \brief Return the expected cost of supporting the floating point operation | /// \brief Return the expected cost of supporting the floating point operation | ||||
/// of the specified type. | /// of the specified type. | ||||
▲ Show 20 Lines • Show All 238 Lines • ▼ Show 20 Lines | public: | ||||
virtual bool isTruncateFree(Type *Ty1, Type *Ty2) = 0; | virtual bool isTruncateFree(Type *Ty1, Type *Ty2) = 0; | ||||
virtual bool isProfitableToHoist(Instruction *I) = 0; | virtual bool isProfitableToHoist(Instruction *I) = 0; | ||||
virtual bool isTypeLegal(Type *Ty) = 0; | virtual bool isTypeLegal(Type *Ty) = 0; | ||||
virtual unsigned getJumpBufAlignment() = 0; | virtual unsigned getJumpBufAlignment() = 0; | ||||
virtual unsigned getJumpBufSize() = 0; | virtual unsigned getJumpBufSize() = 0; | ||||
virtual bool shouldBuildLookupTables() = 0; | virtual bool shouldBuildLookupTables() = 0; | ||||
virtual bool enableAggressiveInterleaving(bool LoopHasReductions) = 0; | virtual bool enableAggressiveInterleaving(bool LoopHasReductions) = 0; | ||||
virtual bool enableInterleavedAccessVectorization() = 0; | virtual bool enableInterleavedAccessVectorization() = 0; | ||||
virtual bool enablePotentiallyUnsafeFPVectorization() = 0; | |||||
virtual PopcntSupportKind getPopcntSupport(unsigned IntTyWidthInBit) = 0; | virtual PopcntSupportKind getPopcntSupport(unsigned IntTyWidthInBit) = 0; | ||||
virtual bool haveFastSqrt(Type *Ty) = 0; | virtual bool haveFastSqrt(Type *Ty) = 0; | ||||
virtual int getFPOpCost(Type *Ty) = 0; | virtual int getFPOpCost(Type *Ty) = 0; | ||||
virtual int getIntImmCost(const APInt &Imm, Type *Ty) = 0; | virtual int getIntImmCost(const APInt &Imm, Type *Ty) = 0; | ||||
virtual int getIntImmCost(unsigned Opc, unsigned Idx, const APInt &Imm, | virtual int getIntImmCost(unsigned Opc, unsigned Idx, const APInt &Imm, | ||||
Type *Ty) = 0; | Type *Ty) = 0; | ||||
virtual int getIntImmCost(Intrinsic::ID IID, unsigned Idx, const APInt &Imm, | virtual int getIntImmCost(Intrinsic::ID IID, unsigned Idx, const APInt &Imm, | ||||
Type *Ty) = 0; | Type *Ty) = 0; | ||||
▲ Show 20 Lines • Show All 140 Lines • ▼ Show 20 Lines | bool shouldBuildLookupTables() override { | ||||
return Impl.shouldBuildLookupTables(); | return Impl.shouldBuildLookupTables(); | ||||
} | } | ||||
bool enableAggressiveInterleaving(bool LoopHasReductions) override { | bool enableAggressiveInterleaving(bool LoopHasReductions) override { | ||||
return Impl.enableAggressiveInterleaving(LoopHasReductions); | return Impl.enableAggressiveInterleaving(LoopHasReductions); | ||||
} | } | ||||
bool enableInterleavedAccessVectorization() override { | bool enableInterleavedAccessVectorization() override { | ||||
return Impl.enableInterleavedAccessVectorization(); | return Impl.enableInterleavedAccessVectorization(); | ||||
} | } | ||||
bool enablePotentiallyUnsafeFPVectorization() override { | |||||
return Impl.enablePotentiallyUnsafeFPVectorization(); | |||||
} | |||||
PopcntSupportKind getPopcntSupport(unsigned IntTyWidthInBit) override { | PopcntSupportKind getPopcntSupport(unsigned IntTyWidthInBit) override { | ||||
return Impl.getPopcntSupport(IntTyWidthInBit); | return Impl.getPopcntSupport(IntTyWidthInBit); | ||||
} | } | ||||
bool haveFastSqrt(Type *Ty) override { return Impl.haveFastSqrt(Ty); } | bool haveFastSqrt(Type *Ty) override { return Impl.haveFastSqrt(Ty); } | ||||
int getFPOpCost(Type *Ty) override { return Impl.getFPOpCost(Ty); } | int getFPOpCost(Type *Ty) override { return Impl.getFPOpCost(Ty); } | ||||
int getIntImmCost(const APInt &Imm, Type *Ty) override { | int getIntImmCost(const APInt &Imm, Type *Ty) override { | ||||
▲ Show 20 Lines • Show All 212 Lines • Show Last 20 Lines |
The name of this method, and the corresponding comment, seem potentially confusing (no pun intended ;) ). It does not explain which floating-point operations are potentially unsafe (essentially all of them?). I think it would be much better to name this:
perhaps with this comment: