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/TargetSubtargetInfo.h"
21 #include "llvm/IR/DataLayout.h"
22 #include "llvm/Target/TargetMachine.h"
24 #define GET_SUBTARGETINFO_HEADER
25 #include "LanaiGenSubtargetInfo.inc"
29 class LanaiSubtarget
: public LanaiGenSubtargetInfo
{
31 // This constructor initializes the data members to match that
32 // of the specified triple.
33 LanaiSubtarget(const Triple
&TargetTriple
, StringRef Cpu
,
34 StringRef FeatureString
, const TargetMachine
&TM
,
35 const TargetOptions
&Options
, CodeModel::Model CodeModel
,
36 CodeGenOptLevel OptLevel
);
38 // ParseSubtargetFeatures - Parses features string setting specified
39 // subtarget options. Definition of function is auto generated by tblgen.
40 void ParseSubtargetFeatures(StringRef CPU
, StringRef TuneCPU
, StringRef FS
);
42 LanaiSubtarget
&initializeSubtargetDependencies(StringRef CPU
, StringRef FS
);
44 void initSubtargetFeatures(StringRef CPU
, StringRef FS
);
46 bool enableMachineScheduler() const override
{ return true; }
48 const LanaiInstrInfo
*getInstrInfo() const override
{ return &InstrInfo
; }
50 const TargetFrameLowering
*getFrameLowering() const override
{
51 return &FrameLowering
;
54 const LanaiRegisterInfo
*getRegisterInfo() const override
{
55 return &InstrInfo
.getRegisterInfo();
58 const LanaiTargetLowering
*getTargetLowering() const override
{
62 const LanaiSelectionDAGInfo
*getSelectionDAGInfo() const override
{
67 LanaiFrameLowering FrameLowering
;
68 LanaiInstrInfo InstrInfo
;
69 LanaiTargetLowering TLInfo
;
70 LanaiSelectionDAGInfo TSInfo
;
74 #endif // LLVM_LIB_TARGET_LANAI_LANAISUBTARGET_H