• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //=====-- LanaiSubtarget.h - Define Subtarget for the Lanai -----*- 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 declares the Lanai specific subclass of TargetSubtarget.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_LANAI_LANAISUBTARGET_H
15 #define LLVM_LIB_TARGET_LANAI_LANAISUBTARGET_H
16 
17 #include "LanaiFrameLowering.h"
18 #include "LanaiISelLowering.h"
19 #include "LanaiInstrInfo.h"
20 #include "LanaiSelectionDAGInfo.h"
21 #include "llvm/CodeGen/TargetFrameLowering.h"
22 #include "llvm/CodeGen/TargetSubtargetInfo.h"
23 #include "llvm/IR/DataLayout.h"
24 #include "llvm/Target/TargetMachine.h"
25 
26 #define GET_SUBTARGETINFO_HEADER
27 #include "LanaiGenSubtargetInfo.inc"
28 
29 namespace llvm {
30 
31 class LanaiSubtarget : public LanaiGenSubtargetInfo {
32 public:
33   // This constructor initializes the data members to match that
34   // of the specified triple.
35   LanaiSubtarget(const Triple &TargetTriple, StringRef Cpu,
36                  StringRef FeatureString, const TargetMachine &TM,
37                  const TargetOptions &Options, CodeModel::Model CodeModel,
38                  CodeGenOpt::Level OptLevel);
39 
40   // ParseSubtargetFeatures - Parses features string setting specified
41   // subtarget options.  Definition of function is auto generated by tblgen.
42   void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
43 
44   LanaiSubtarget &initializeSubtargetDependencies(StringRef CPU, StringRef FS);
45 
46   void initSubtargetFeatures(StringRef CPU, StringRef FS);
47 
enableMachineScheduler()48   bool enableMachineScheduler() const override { return true; }
49 
getInstrInfo()50   const LanaiInstrInfo *getInstrInfo() const override { return &InstrInfo; }
51 
getFrameLowering()52   const TargetFrameLowering *getFrameLowering() const override {
53     return &FrameLowering;
54   }
55 
getRegisterInfo()56   const LanaiRegisterInfo *getRegisterInfo() const override {
57     return &InstrInfo.getRegisterInfo();
58   }
59 
getTargetLowering()60   const LanaiTargetLowering *getTargetLowering() const override {
61     return &TLInfo;
62   }
63 
getSelectionDAGInfo()64   const LanaiSelectionDAGInfo *getSelectionDAGInfo() const override {
65     return &TSInfo;
66   }
67 
68 private:
69   LanaiFrameLowering FrameLowering;
70   LanaiInstrInfo InstrInfo;
71   LanaiTargetLowering TLInfo;
72   LanaiSelectionDAGInfo TSInfo;
73 };
74 } // namespace llvm
75 
76 #endif // LLVM_LIB_TARGET_LANAI_LANAISUBTARGET_H
77