Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/include/llvm/Analysis/TargetTransformInfo.h
Show All 24 Lines | |||||
#include "llvm/IR/Operator.h" | #include "llvm/IR/Operator.h" | ||||
#include "llvm/IR/PassManager.h" | #include "llvm/IR/PassManager.h" | ||||
#include "llvm/Pass.h" | #include "llvm/Pass.h" | ||||
#include "llvm/Support/AtomicOrdering.h" | #include "llvm/Support/AtomicOrdering.h" | ||||
#include "llvm/Support/DataTypes.h" | #include "llvm/Support/DataTypes.h" | ||||
#include "llvm/Analysis/LoopInfo.h" | #include "llvm/Analysis/LoopInfo.h" | ||||
#include "llvm/Analysis/ScalarEvolution.h" | #include "llvm/Analysis/ScalarEvolution.h" | ||||
#include "llvm/IR/Dominators.h" | #include "llvm/IR/Dominators.h" | ||||
#include "llvm/Analysis/AssumptionCache.h" | |||||
#include <functional> | #include <functional> | ||||
namespace llvm { | namespace llvm { | ||||
namespace Intrinsic { | namespace Intrinsic { | ||||
enum ID : unsigned; | enum ID : unsigned; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 478 Lines • ▼ Show 20 Lines | public: | ||||
bool isLSRCostLess(TargetTransformInfo::LSRCost &C1, | bool isLSRCostLess(TargetTransformInfo::LSRCost &C1, | ||||
TargetTransformInfo::LSRCost &C2) const; | TargetTransformInfo::LSRCost &C2) const; | ||||
/// Return true if the target can fuse a compare and branch. | /// Return true if the target can fuse a compare and branch. | ||||
/// Loop-strength-reduction (LSR) uses that knowledge to adjust its cost | /// Loop-strength-reduction (LSR) uses that knowledge to adjust its cost | ||||
/// calculation for the instructions in a loop. | /// calculation for the instructions in a loop. | ||||
bool canMacroFuseCmp() const; | bool canMacroFuseCmp() const; | ||||
/// Return true if the target can save a compare for loop count, for example | |||||
/// hardware loop saves a compare. | |||||
bool canSaveCmp(Loop *L, BranchInst **BI, ScalarEvolution *SE, LoopInfo *LI, | |||||
DominatorTree *DT, AssumptionCache *AC, | |||||
TargetLibraryInfo *LibInfo) const; | |||||
/// \return True is LSR should make efforts to create/preserve post-inc | /// \return True is LSR should make efforts to create/preserve post-inc | ||||
/// addressing mode expressions. | /// addressing mode expressions. | ||||
bool shouldFavorPostInc() const; | bool shouldFavorPostInc() const; | ||||
/// Return true if LSR should make efforts to generate indexed addressing | /// Return true if LSR should make efforts to generate indexed addressing | ||||
/// modes that operate across loop iterations. | /// modes that operate across loop iterations. | ||||
bool shouldFavorBackedgeIndex(const Loop *L) const; | bool shouldFavorBackedgeIndex(const Loop *L) const; | ||||
▲ Show 20 Lines • Show All 590 Lines • ▼ Show 20 Lines | public: | ||||
virtual bool isLegalAddressingMode(Type *Ty, GlobalValue *BaseGV, | virtual bool isLegalAddressingMode(Type *Ty, GlobalValue *BaseGV, | ||||
int64_t BaseOffset, bool HasBaseReg, | int64_t BaseOffset, bool HasBaseReg, | ||||
int64_t Scale, | int64_t Scale, | ||||
unsigned AddrSpace, | unsigned AddrSpace, | ||||
Instruction *I) = 0; | Instruction *I) = 0; | ||||
virtual bool isLSRCostLess(TargetTransformInfo::LSRCost &C1, | virtual bool isLSRCostLess(TargetTransformInfo::LSRCost &C1, | ||||
TargetTransformInfo::LSRCost &C2) = 0; | TargetTransformInfo::LSRCost &C2) = 0; | ||||
virtual bool canMacroFuseCmp() = 0; | virtual bool canMacroFuseCmp() = 0; | ||||
virtual bool canSaveCmp(Loop *L, BranchInst **BI, ScalarEvolution *SE, | |||||
LoopInfo *LI, DominatorTree *DT, AssumptionCache *AC, | |||||
TargetLibraryInfo *LibInfo) = 0; | |||||
virtual bool shouldFavorPostInc() const = 0; | virtual bool shouldFavorPostInc() const = 0; | ||||
virtual bool shouldFavorBackedgeIndex(const Loop *L) const = 0; | virtual bool shouldFavorBackedgeIndex(const Loop *L) const = 0; | ||||
virtual bool isLegalMaskedStore(Type *DataType) = 0; | virtual bool isLegalMaskedStore(Type *DataType) = 0; | ||||
virtual bool isLegalMaskedLoad(Type *DataType) = 0; | virtual bool isLegalMaskedLoad(Type *DataType) = 0; | ||||
virtual bool isLegalNTStore(Type *DataType, unsigned Alignment) = 0; | virtual bool isLegalNTStore(Type *DataType, unsigned Alignment) = 0; | ||||
virtual bool isLegalNTLoad(Type *DataType, unsigned Alignment) = 0; | virtual bool isLegalNTLoad(Type *DataType, unsigned Alignment) = 0; | ||||
virtual bool isLegalMaskedScatter(Type *DataType) = 0; | virtual bool isLegalMaskedScatter(Type *DataType) = 0; | ||||
virtual bool isLegalMaskedGather(Type *DataType) = 0; | virtual bool isLegalMaskedGather(Type *DataType) = 0; | ||||
▲ Show 20 Lines • Show All 234 Lines • ▼ Show 20 Lines | public: | ||||
} | } | ||||
bool isLSRCostLess(TargetTransformInfo::LSRCost &C1, | bool isLSRCostLess(TargetTransformInfo::LSRCost &C1, | ||||
TargetTransformInfo::LSRCost &C2) override { | TargetTransformInfo::LSRCost &C2) override { | ||||
return Impl.isLSRCostLess(C1, C2); | return Impl.isLSRCostLess(C1, C2); | ||||
} | } | ||||
bool canMacroFuseCmp() override { | bool canMacroFuseCmp() override { | ||||
return Impl.canMacroFuseCmp(); | return Impl.canMacroFuseCmp(); | ||||
} | } | ||||
bool canSaveCmp(Loop *L, BranchInst **BI, | |||||
ScalarEvolution *SE, | |||||
LoopInfo *LI, DominatorTree *DT, AssumptionCache *AC, | |||||
TargetLibraryInfo *LibInfo) override { | |||||
return Impl.canSaveCmp(L, BI, SE, LI, DT, AC, LibInfo); | |||||
} | |||||
bool shouldFavorPostInc() const override { | bool shouldFavorPostInc() const override { | ||||
return Impl.shouldFavorPostInc(); | return Impl.shouldFavorPostInc(); | ||||
} | } | ||||
bool shouldFavorBackedgeIndex(const Loop *L) const override { | bool shouldFavorBackedgeIndex(const Loop *L) const override { | ||||
return Impl.shouldFavorBackedgeIndex(L); | return Impl.shouldFavorBackedgeIndex(L); | ||||
} | } | ||||
bool isLegalMaskedStore(Type *DataType) override { | bool isLegalMaskedStore(Type *DataType) override { | ||||
return Impl.isLegalMaskedStore(DataType); | return Impl.isLegalMaskedStore(DataType); | ||||
▲ Show 20 Lines • Show All 435 Lines • Show Last 20 Lines |