1 //=====-- LanaiSubtarget.h - Define Subtarget for the Lanai -----*- C++ -*--==//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file declares the Lanai specific subclass of TargetSubtarget.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_LIB_TARGET_LANAI_LANAISUBTARGET_H
14 #define LLVM_LIB_TARGET_LANAI_LANAISUBTARGET_H
16 #include "LanaiFrameLowering.h"
17 #include "LanaiISelLowering.h"
18 #include "LanaiInstrInfo.h"
19 #include "LanaiSelectionDAGInfo.h"
20 #include "llvm/CodeGen/TargetFrameLowering.h"
21 #include "llvm/CodeGen/TargetSubtargetInfo.h"
22 #include "llvm/IR/DataLayout.h"
23 #include "llvm/Target/TargetMachine.h"
25 #define GET_SUBTARGETINFO_HEADER
26 #include "LanaiGenSubtargetInfo.inc"
30 class LanaiSubtarget
: public LanaiGenSubtargetInfo
{
32 // This constructor initializes the data members to match that
33 // of the specified triple.
34 LanaiSubtarget(const Triple
&TargetTriple
, StringRef Cpu
,
35 StringRef FeatureString
, const TargetMachine
&TM
,
36 const TargetOptions
&Options
, CodeModel::Model CodeModel
,
37 CodeGenOpt::Level OptLevel
);
39 // ParseSubtargetFeatures - Parses features string setting specified
40 // subtarget options. Definition of function is auto generated by tblgen.
41 void ParseSubtargetFeatures(StringRef CPU
, StringRef FS
);
43 LanaiSubtarget
&initializeSubtargetDependencies(StringRef CPU
, StringRef FS
);
45 void initSubtargetFeatures(StringRef CPU
, StringRef FS
);
47 bool enableMachineScheduler() const override
{ return true; }
49 const LanaiInstrInfo
*getInstrInfo() const override
{ return &InstrInfo
; }
51 const TargetFrameLowering
*getFrameLowering() const override
{
52 return &FrameLowering
;
55 const LanaiRegisterInfo
*getRegisterInfo() const override
{
56 return &InstrInfo
.getRegisterInfo();
59 const LanaiTargetLowering
*getTargetLowering() const override
{
63 const LanaiSelectionDAGInfo
*getSelectionDAGInfo() const override
{
68 LanaiFrameLowering FrameLowering
;
69 LanaiInstrInfo InstrInfo
;
70 LanaiTargetLowering TLInfo
;
71 LanaiSelectionDAGInfo TSInfo
;
75 #endif // LLVM_LIB_TARGET_LANAI_LANAISUBTARGET_H