1 //==-- llvm/Target/TargetSubtargetInfo.h - Target Information ----*- C++ -*-==//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file describes the subtarget options of a Target machine.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_TARGET_TARGETSUBTARGETINFO_H
15 #define LLVM_TARGET_TARGETSUBTARGETINFO_H
17 #include "llvm/MC/MCSubtargetInfo.h"
18 #include "llvm/Support/CodeGen.h"
25 class TargetRegisterClass;
26 class TargetSchedModel;
27 template <typename T> class SmallVectorImpl;
29 //===----------------------------------------------------------------------===//
31 /// TargetSubtargetInfo - Generic base class for all target subtargets. All
32 /// Target-specific options that control code generation and printing should
33 /// be exposed through a TargetSubtargetInfo-derived class.
35 class TargetSubtargetInfo : public MCSubtargetInfo {
36 TargetSubtargetInfo(const TargetSubtargetInfo&) LLVM_DELETED_FUNCTION;
37 void operator=(const TargetSubtargetInfo&) LLVM_DELETED_FUNCTION;
38 protected: // Can only create subclasses...
39 TargetSubtargetInfo();
41 // AntiDepBreakMode - Type of anti-dependence breaking that should
42 // be performed before post-RA scheduling.
43 typedef enum { ANTIDEP_NONE, ANTIDEP_CRITICAL, ANTIDEP_ALL } AntiDepBreakMode;
44 typedef SmallVectorImpl<const TargetRegisterClass*> RegClassVector;
46 virtual ~TargetSubtargetInfo();
48 /// Resolve a SchedClass at runtime, where SchedClass identifies an
49 /// MCSchedClassDesc with the isVariant property. This may return the ID of
50 /// another variant SchedClass, but repeated invocation must quickly terminate
51 /// in a nonvariant SchedClass.
52 virtual unsigned resolveSchedClass(unsigned SchedClass, const MachineInstr *MI,
53 const TargetSchedModel* SchedModel) const {
57 /// \brief True if the subtarget should run MachineScheduler after aggressive
60 /// This currently replaces the SelectionDAG scheduler with the "source" order
61 /// scheduler. It does not yet disable the postRA scheduler.
62 virtual bool enableMachineScheduler() const;
64 // enablePostRAScheduler - If the target can benefit from post-regalloc
65 // scheduling and the specified optimization level meets the requirement
66 // return true to enable post-register-allocation scheduling. In
67 // CriticalPathRCs return any register classes that should only be broken
68 // if on the critical path.
69 virtual bool enablePostRAScheduler(CodeGenOpt::Level OptLevel,
70 AntiDepBreakMode& Mode,
71 RegClassVector& CriticalPathRCs) const;
72 // adjustSchedDependency - Perform target specific adjustments to
73 // the latency of a schedule dependency.
74 virtual void adjustSchedDependency(SUnit *def, SUnit *use,
78 } // End llvm namespace