LLVM 24.0.0git
ARCSubtarget.h
Go to the documentation of this file.
1//===- ARCSubtarget.h - Define Subtarget for the ARC ------------*- C++ -*-===//
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// This file declares the ARC specific subclass of TargetSubtargetInfo.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_LIB_TARGET_ARC_ARCSUBTARGET_H
14#define LLVM_LIB_TARGET_ARC_ARCSUBTARGET_H
15
16#include "ARCFrameLowering.h"
17#include "ARCISelLowering.h"
18#include "ARCInstrInfo.h"
20#include <string>
21
22#define OPTIONS_STRUCT_DECL
23#include "ARCOptions.inc"
24
25#define GET_SUBTARGETINFO_HEADER
26#include "ARCGenSubtargetInfo.inc"
27
28namespace llvm {
29
30class ARCTargetMachine;
31class StringRef;
32
34 const ARCOptions &CLOpts;
35 virtual void anchor();
36 ARCInstrInfo InstrInfo;
37 ARCFrameLowering FrameLowering;
38 ARCTargetLowering TLInfo;
39 std::unique_ptr<const SelectionDAGTargetInfo> TSInfo;
40
41 // ARC processor extensions
42 bool Xnorm = false;
43
44public:
45 /// This constructor initializes the data members to match that
46 /// of the specified triple.
47 ARCSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS,
48 const ARCTargetMachine &TM);
49
50 ~ARCSubtarget() override;
51
52 const ARCOptions &getCLOpts() const { return CLOpts; }
53
54 /// Parses features string setting specified subtarget options.
55 /// Definition of function is auto generated by tblgen.
57
58 const ARCInstrInfo *getInstrInfo() const override { return &InstrInfo; }
59 const ARCFrameLowering *getFrameLowering() const override {
60 return &FrameLowering;
61 }
62 const ARCTargetLowering *getTargetLowering() const override {
63 return &TLInfo;
64 }
65 const ARCRegisterInfo *getRegisterInfo() const override {
66 return &InstrInfo.getRegisterInfo();
67 }
68
69 const SelectionDAGTargetInfo *getSelectionDAGInfo() const override;
70
71 bool hasNorm() const { return Xnorm; }
72};
73
74} // end namespace llvm
75
76#endif // LLVM_LIB_TARGET_ARC_ARCSUBTARGET_H
ARCSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS, const ARCTargetMachine &TM)
This constructor initializes the data members to match that of the specified triple.
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
Parses features string setting specified subtarget options.
const ARCTargetLowering * getTargetLowering() const override
const ARCOptions & getCLOpts() const
const SelectionDAGTargetInfo * getSelectionDAGInfo() const override
bool hasNorm() const
~ARCSubtarget() override
const ARCInstrInfo * getInstrInfo() const override
const ARCFrameLowering * getFrameLowering() const override
const ARCRegisterInfo * getRegisterInfo() const override
Targets can subclass this to parameterize the SelectionDAG lowering and instruction selection process...
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
Triple - Helper class for working with autoconf configuration names.
Definition Triple.h:48
This is an optimization pass for GlobalISel generic memory operations.