LLVM 22.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 GET_SUBTARGETINFO_HEADER
23#include "ARCGenSubtargetInfo.inc"
24
25namespace llvm {
26
27class StringRef;
28class TargetMachine;
29
31 virtual void anchor();
32 ARCInstrInfo InstrInfo;
33 ARCFrameLowering FrameLowering;
34 ARCTargetLowering TLInfo;
35 std::unique_ptr<const SelectionDAGTargetInfo> TSInfo;
36
37 // ARC processor extensions
38 bool Xnorm = false;
39
40public:
41 /// This constructor initializes the data members to match that
42 /// of the specified triple.
43 ARCSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS,
44 const TargetMachine &TM);
45
46 ~ARCSubtarget() override;
47
48 /// Parses features string setting specified subtarget options.
49 /// Definition of function is auto generated by tblgen.
51
52 const ARCInstrInfo *getInstrInfo() const override { return &InstrInfo; }
53 const ARCFrameLowering *getFrameLowering() const override {
54 return &FrameLowering;
55 }
56 const ARCTargetLowering *getTargetLowering() const override {
57 return &TLInfo;
58 }
59 const ARCRegisterInfo *getRegisterInfo() const override {
60 return &InstrInfo.getRegisterInfo();
61 }
62
63 const SelectionDAGTargetInfo *getSelectionDAGInfo() const override;
64
65 bool hasNorm() const { return Xnorm; }
66};
67
68} // end namespace llvm
69
70#endif // LLVM_LIB_TARGET_ARC_ARCSUBTARGET_H
const ARCRegisterInfo & getRegisterInfo() const
Definition: ARCInstrInfo.h:33
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
Parses features string setting specified subtarget options.
const ARCTargetLowering * getTargetLowering() const override
Definition: ARCSubtarget.h:56
const SelectionDAGTargetInfo * getSelectionDAGInfo() const override
bool hasNorm() const
Definition: ARCSubtarget.h:65
~ARCSubtarget() override
const ARCInstrInfo * getInstrInfo() const override
Definition: ARCSubtarget.h:52
const ARCFrameLowering * getFrameLowering() const override
Definition: ARCSubtarget.h:53
const ARCRegisterInfo * getRegisterInfo() const override
Definition: ARCSubtarget.h:59
Targets can subclass this to parameterize the SelectionDAG lowering and instruction selection process...
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:55
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:83
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:47
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18