LLVM 22.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"
21#include "llvm/IR/DataLayout.h"
22#include <string>
23
24#define GET_SUBTARGETINFO_HEADER
25#include "VEGenSubtargetInfo.inc"
26
27namespace llvm {
28class StringRef;
29
31 Triple TargetTriple;
32 virtual void anchor();
33
34 /// Features {
35
36 // Emit VPU instructions
37 bool EnableVPU;
38
39 /// } Features
40
41 VEInstrInfo InstrInfo;
42 VETargetLowering TLInfo;
43 std::unique_ptr<const SelectionDAGTargetInfo> TSInfo;
44 VEFrameLowering FrameLowering;
45
46public:
47 VESubtarget(const Triple &TT, const std::string &CPU, const std::string &FS,
48 const TargetMachine &TM);
49
50 ~VESubtarget() override;
51
52 const VEInstrInfo *getInstrInfo() const override { return &InstrInfo; }
53 const VEFrameLowering *getFrameLowering() const override {
54 return &FrameLowering;
55 }
56 const VERegisterInfo *getRegisterInfo() const override {
57 return &InstrInfo.getRegisterInfo();
58 }
59 const VETargetLowering *getTargetLowering() const override { return &TLInfo; }
60
61 const SelectionDAGTargetInfo *getSelectionDAGInfo() const override;
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
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.
Triple - Helper class for working with autoconf configuration names.
Definition Triple.h:47
~VESubtarget() override
uint64_t getAdjustedFrameSize(uint64_t FrameSize) const
Given a actual stack size as determined by FrameInfo, this function returns adjusted framesize which ...
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
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
const SelectionDAGTargetInfo * getSelectionDAGInfo() const override
VESubtarget & initializeSubtargetDependencies(StringRef CPU, StringRef FS)
const VEInstrInfo * getInstrInfo() const override
Definition VESubtarget.h:52
const VETargetLowering * getTargetLowering() const override
Definition VESubtarget.h:59
VESubtarget(const Triple &TT, const std::string &CPU, const std::string &FS, const TargetMachine &TM)
const VEFrameLowering * getFrameLowering() const override
Definition VESubtarget.h:53
const VERegisterInfo * getRegisterInfo() const override
Definition VESubtarget.h:56
This is an optimization pass for GlobalISel generic memory operations.