summaryrefslogtreecommitdiff
path: root/include/llvm/Analysis/TargetTransformInfo.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Analysis/TargetTransformInfo.h')
-rw-r--r--include/llvm/Analysis/TargetTransformInfo.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/Analysis/TargetTransformInfo.h b/include/llvm/Analysis/TargetTransformInfo.h
index a8975b7a4f..f2613e35c5 100644
--- a/include/llvm/Analysis/TargetTransformInfo.h
+++ b/include/llvm/Analysis/TargetTransformInfo.h
@@ -92,6 +92,7 @@ public:
enum TargetCostConstants {
TCC_Free = 0, ///< Expected to fold away in lowering.
TCC_Basic = 1, ///< The cost of a typical 'add' instruction.
+ TCC_Load = 3,
TCC_Expensive = 4 ///< The cost of a 'div' instruction on x86.
};
@@ -299,6 +300,13 @@ public:
/// immediate of the specified type.
virtual unsigned getIntImmCost(const APInt &Imm, Type *Ty) const;
+ /// \brief Return the expected cost of materialization for the given integer
+ /// immediate of the specified type for a given instruction. The cost can be
+ /// zero if the immediate can be folded into the specified instruction.
+ virtual unsigned getIntImmCost(unsigned Opcode, const APInt &Imm,
+ Type *Ty) const;
+ virtual unsigned getIntImmCost(Intrinsic::ID IID, const APInt &Imm,
+ Type *Ty) const;
/// @}
/// \name Vector Target Information