summaryrefslogtreecommitdiff
path: root/include/llvm/Target/TargetMachine.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Target/TargetMachine.h')
-rw-r--r--include/llvm/Target/TargetMachine.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/include/llvm/Target/TargetMachine.h b/include/llvm/Target/TargetMachine.h
index 5421b22462ae3..97442f9a7849e 100644
--- a/include/llvm/Target/TargetMachine.h
+++ b/include/llvm/Target/TargetMachine.h
@@ -24,6 +24,7 @@
namespace llvm {
+class Function;
class GlobalValue;
class MachineModuleInfo;
class Mangler;
@@ -38,6 +39,7 @@ class PassManagerBuilder;
class Target;
class TargetIntrinsicInfo;
class TargetIRAnalysis;
+class TargetTransformInfo;
class TargetLoweringObjectFile;
class TargetPassConfig;
class TargetSubtargetInfo;
@@ -204,7 +206,13 @@ public:
/// This is used to construct the new pass manager's target IR analysis pass,
/// set up appropriately for this target machine. Even the old pass manager
/// uses this to answer queries about the IR.
- virtual TargetIRAnalysis getTargetIRAnalysis();
+ TargetIRAnalysis getTargetIRAnalysis();
+
+ /// \brief Return a TargetTransformInfo for a given function.
+ ///
+ /// The returned TargetTransformInfo is specialized to the subtarget
+ /// corresponding to \p F.
+ virtual TargetTransformInfo getTargetTransformInfo(const Function &F);
/// Allow the target to modify the pass manager, e.g. by calling
/// PassManagerBuilder::addExtension.
@@ -280,11 +288,11 @@ protected: // Can only create subclasses.
void initAsmInfo();
public:
- /// \brief Get a TargetIRAnalysis implementation for the target.
+ /// \brief Get a TargetTransformInfo implementation for the target.
///
- /// This analysis will produce a TTI result which uses the common code
- /// generator to answer queries about the IR.
- TargetIRAnalysis getTargetIRAnalysis() override;
+ /// The TTI returned uses the common code generator to answer queries about
+ /// the IR.
+ TargetTransformInfo getTargetTransformInfo(const Function &F) override;
/// Create a pass configuration object to be used by addPassToEmitX methods
/// for generating a pipeline of CodeGen passes.