Add callback to allow target to adjust latency of schedule dependency edge.
[oota-llvm.git] / include / llvm / Target / TargetSubtarget.h
index 875008deaf6c7cd09f7d0e2f523b88e8b9ef249b..c86e81554ced659d53670a9ac51c8970b66a158b 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by Nate Begeman and is distributed under the
-// University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
 #ifndef LLVM_TARGET_TARGETSUBTARGET_H
 #define LLVM_TARGET_TARGETSUBTARGET_H
 
-#include <string>
-
 namespace llvm {
 
+class SDep;
+
 //===----------------------------------------------------------------------===//
 ///
 /// TargetSubtarget - Generic base class for all target subtargets.  All
@@ -27,13 +27,20 @@ namespace llvm {
 class TargetSubtarget {
   TargetSubtarget(const TargetSubtarget&);   // DO NOT IMPLEMENT
   void operator=(const TargetSubtarget&);  // DO NOT IMPLEMENT
-  std::string CPU; // CPU name.
 protected: // Can only create subclasses...
   TargetSubtarget();
 public:
   virtual ~TargetSubtarget();
-  void setCPU(const std::string &C) { CPU = C; }
-  const std::string &getCPU() const { return CPU; }
+
+  /// getSpecialAddressLatency - For targets where it is beneficial to
+  /// backschedule instructions that compute addresses, return a value
+  /// indicating the number of scheduling cycles of backscheduling that
+  /// should be attempted.
+  virtual unsigned getSpecialAddressLatency() const { return 0; }
+
+  // adjustSchedDependency - Perform target specific adjustments to
+  // the latency of a schedule dependency.
+  virtual void adjustSchedDependency(SDep&) const { };
 };
 
 } // End llvm namespace