1 //===-- XtensaSubtarget.h - Define Subtarget for the Xtensa ----*- 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 Xtensa specific subclass of TargetSubtargetInfo.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_LIB_TARGET_XTENSA_XTENSASUBTARGET_H
14 #define LLVM_LIB_TARGET_XTENSA_XTENSASUBTARGET_H
16 #include "XtensaFrameLowering.h"
17 #include "XtensaISelLowering.h"
18 #include "XtensaInstrInfo.h"
19 #include "XtensaRegisterInfo.h"
20 #include "llvm/CodeGen/SelectionDAGTargetInfo.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 "XtensaGenSubtargetInfo.inc"
31 class XtensaSubtarget
: public XtensaGenSubtargetInfo
{
33 const Triple
&TargetTriple
;
34 XtensaInstrInfo InstrInfo
;
35 XtensaTargetLowering TLInfo
;
36 SelectionDAGTargetInfo TSInfo
;
37 XtensaFrameLowering FrameLowering
;
39 // Enabled Xtensa Density extension
42 XtensaSubtarget
&initializeSubtargetDependencies(StringRef CPU
, StringRef FS
);
45 XtensaSubtarget(const Triple
&TT
, StringRef CPU
, StringRef FS
,
46 const TargetMachine
&TM
);
48 const Triple
&getTargetTriple() const { return TargetTriple
; }
50 const TargetFrameLowering
*getFrameLowering() const override
{
51 return &FrameLowering
;
53 const XtensaInstrInfo
*getInstrInfo() const override
{ return &InstrInfo
; }
54 const XtensaRegisterInfo
*getRegisterInfo() const override
{
55 return &InstrInfo
.getRegisterInfo();
58 const XtensaTargetLowering
*getTargetLowering() const override
{
61 const SelectionDAGTargetInfo
*getSelectionDAGInfo() const override
{
65 bool hasDensity() const { return HasDensity
; }
67 // Automatically generated by tblgen.
68 void ParseSubtargetFeatures(StringRef CPU
, StringRef TuneCPU
, StringRef FS
);
70 } // end namespace llvm
72 #endif /* LLVM_LIB_TARGET_XTENSA_XTENSASUBTARGET_H */