LLVM 19.0.0git
VESubtarget.h
Go to the documentation of this file.
1//===-- VESubtarget.h - Define Subtarget for the VE -------------*- 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 VE specific subclass of TargetSubtargetInfo.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_LIB_TARGET_VE_VESUBTARGET_H
14#define LLVM_LIB_TARGET_VE_VESUBTARGET_H
15
16#include "VEFrameLowering.h"
17#include "VEISelLowering.h"
18#include "VEInstrInfo.h"
22#include "llvm/IR/DataLayout.h"
23#include <string>
24
25#define GET_SUBTARGETINFO_HEADER
26#include "VEGenSubtargetInfo.inc"
27
28namespace llvm {
29class StringRef;
30
32 Triple TargetTriple;
33 virtual void anchor();
34
35 /// Features {
36
37 // Emit VPU instructions
38 bool EnableVPU;
39
40 /// } Features
41
42 VEInstrInfo InstrInfo;
43 VETargetLowering TLInfo;
45 VEFrameLowering FrameLowering;
46
47public:
48 VESubtarget(const Triple &TT, const std::string &CPU, const std::string &FS,
49 const TargetMachine &TM);
50
51 const VEInstrInfo *getInstrInfo() const override { return &InstrInfo; }
52 const VEFrameLowering *getFrameLowering() const override {
53 return &FrameLowering;
54 }
55 const VERegisterInfo *getRegisterInfo() const override {
56 return &InstrInfo.getRegisterInfo();
57 }
58 const VETargetLowering *getTargetLowering() const override { return &TLInfo; }
60 return &TSInfo;
61 }
62
63 bool enableMachineScheduler() const override;
64
65 bool enableVPU() const { return EnableVPU; }
66
67 /// ParseSubtargetFeatures - Parses features string setting specified
68 /// subtarget options. Definition of function is auto generated by tblgen.
71
72 /// Given a actual stack size as determined by FrameInfo, this function
73 /// returns adjusted framesize which includes space for RSA, return
74 /// address, and frame poitner.
75 uint64_t getAdjustedFrameSize(uint64_t FrameSize) const;
76
77 /// Get the size of RSA, return address, and frame pointer as described
78 /// in VEFrameLowering.cpp.
79 unsigned getRsaSize() const { return 176; };
80
81 bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
82};
83
84} // namespace llvm
85
86#endif
const char LLVMTargetMachineRef TM
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:50
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:76
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
bool isOSLinux() const
Tests whether the OS is Linux.
Definition: Triple.h:662
const VERegisterInfo & getRegisterInfo() const
getRegisterInfo - TargetInstrInfo is a superset of MRegister info.
Definition: VEInstrInfo.h:62
uint64_t getAdjustedFrameSize(uint64_t FrameSize) const
Given a actual stack size as determined by FrameInfo, this function returns adjusted framesize which ...
Definition: VESubtarget.cpp:50
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
ParseSubtargetFeatures - Parses features string setting specified subtarget options.
bool enableVPU() const
Definition: VESubtarget.h:65
bool enableMachineScheduler() const override
Definition: VESubtarget.cpp:61
unsigned getRsaSize() const
Get the size of RSA, return address, and frame pointer as described in VEFrameLowering....
Definition: VESubtarget.h:79
bool isTargetLinux() const
Definition: VESubtarget.h:81
VESubtarget & initializeSubtargetDependencies(StringRef CPU, StringRef FS)
Definition: VESubtarget.cpp:28
const VEInstrInfo * getInstrInfo() const override
Definition: VESubtarget.h:51
const SelectionDAGTargetInfo * getSelectionDAGInfo() const override
Definition: VESubtarget.h:59
const VETargetLowering * getTargetLowering() const override
Definition: VESubtarget.h:58
const VEFrameLowering * getFrameLowering() const override
Definition: VESubtarget.h:52
const VERegisterInfo * getRegisterInfo() const override
Definition: VESubtarget.h:55
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18