LLVM 24.0.0git
PISASubtarget.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8///
9/// \file
10/// This file declares the PISA subtarget.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_LIB_TARGET_PISA_PISASUBTARGET_H
15#define LLVM_LIB_TARGET_PISA_PISASUBTARGET_H
16
17#include "PISAFrameLowering.h"
18#include "PISAInstrInfo.h"
20#include "llvm/IR/DataLayout.h"
22
23#define GET_SUBTARGETINFO_HEADER
24#include "PISAGenSubtargetInfo.inc"
25
26namespace llvm {
27class StringRef;
28class PISATargetMachine;
29
31private:
32 // Bool members for features defined in PISAFeatures.td.
33#define GET_SUBTARGETINFO_MACRO(ATTRIBUTE, DEFAULT, GETTER) \
34 bool ATTRIBUTE = DEFAULT;
35#include "PISAGenSubtargetInfo.inc"
36
37 PISAInstrInfo InstrInfo;
38 PISAFrameLowering FrameLowering;
39
40public:
41 // This constructor initializes the data members to match that
42 // of the specified triple.
43 PISASubtarget(const Triple &TT, const std::string &CPU, const std::string &FS,
44 const PISATargetMachine &TM);
45 PISASubtarget &initSubtargetDependencies(StringRef CPU, StringRef FS);
46
47 // Parses features string setting specified subtarget options.
48 // TableGen generates the definition from PISA.td, which includes
49 // PISAFeatures.td.
51
52 const PISAInstrInfo *getInstrInfo() const override { return &InstrInfo; }
53 const PISAFrameLowering *getFrameLowering() const override {
54 return &FrameLowering;
55 }
56 const PISARegisterInfo *getRegisterInfo() const override {
57 return &InstrInfo.getRegisterInfo();
58 }
59
60 // Getters for features defined in PISAFeatures.td.
61#define GET_SUBTARGETINFO_MACRO(ATTRIBUTE, DEFAULT, GETTER) \
62 bool GETTER() const { return ATTRIBUTE; }
63#include "PISAGenSubtargetInfo.inc"
64};
65} // namespace llvm
66
67#endif // LLVM_LIB_TARGET_PISA_PISASUBTARGET_H
This file declares frame lowering for the PISA target.
This file declares instruction information for the PISA target.
PISASubtarget(const Triple &TT, const std::string &CPU, const std::string &FS, const PISATargetMachine &TM)
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
PISASubtarget & initSubtargetDependencies(StringRef CPU, StringRef FS)
const PISAInstrInfo * getInstrInfo() const override
const PISAFrameLowering * getFrameLowering() const override
const PISARegisterInfo * getRegisterInfo() const override
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
This is an optimization pass for GlobalISel generic memory operations.