Enhance EmitInstrWithCustomInserter() so target can specify CFG changes that sdisel...
[oota-llvm.git] / include / llvm / Target / TargetSubtarget.h
1 //==-- llvm/Target/TargetSubtarget.h - Target Information --------*- C++ -*-==//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file describes the subtarget options of a Target machine.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_TARGET_TARGETSUBTARGET_H
15 #define LLVM_TARGET_TARGETSUBTARGET_H
16
17 namespace llvm {
18
19 class SDep;
20 class SUnit;
21
22 //===----------------------------------------------------------------------===//
23 ///
24 /// TargetSubtarget - Generic base class for all target subtargets.  All
25 /// Target-specific options that control code generation and printing should
26 /// be exposed through a TargetSubtarget-derived class.
27 ///
28 class TargetSubtarget {
29   TargetSubtarget(const TargetSubtarget&);   // DO NOT IMPLEMENT
30   void operator=(const TargetSubtarget&);  // DO NOT IMPLEMENT
31 protected: // Can only create subclasses...
32   TargetSubtarget();
33 public:
34   virtual ~TargetSubtarget();
35
36   /// getSpecialAddressLatency - For targets where it is beneficial to
37   /// backschedule instructions that compute addresses, return a value
38   /// indicating the number of scheduling cycles of backscheduling that
39   /// should be attempted.
40   virtual unsigned getSpecialAddressLatency() const { return 0; }
41
42   // adjustSchedDependency - Perform target specific adjustments to
43   // the latency of a schedule dependency.
44   virtual void adjustSchedDependency(SUnit *def, SUnit *use, 
45                                      SDep& dep) const { };
46 };
47
48 } // End llvm namespace
49
50 #endif