LLVM  14.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 
28 namespace llvm {
29 class 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 
47 public:
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; }
59  const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
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(void) const { return 176; };
80 
81  bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
82 };
83 
84 } // namespace llvm
85 
86 #endif
llvm::VESubtarget::isTargetLinux
bool isTargetLinux() const
Definition: VESubtarget.h:81
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
TargetFrameLowering.h
llvm::VEInstrInfo::getRegisterInfo
const VERegisterInfo & getRegisterInfo() const
getRegisterInfo - TargetInstrInfo is a superset of MRegister info.
Definition: VEInstrInfo.h:62
llvm::VESubtarget::ParseSubtargetFeatures
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
ParseSubtargetFeatures - Parses features string setting specified subtarget options.
llvm::VESubtarget::getSelectionDAGInfo
const SelectionDAGTargetInfo * getSelectionDAGInfo() const override
Definition: VESubtarget.h:59
llvm::VESubtarget::enableVPU
bool enableVPU() const
Definition: VESubtarget.h:65
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:45
llvm::VESubtarget::getRegisterInfo
const VERegisterInfo * getRegisterInfo() const override
Definition: VESubtarget.h:55
llvm::VESubtarget::initializeSubtargetDependencies
VESubtarget & initializeSubtargetDependencies(StringRef CPU, StringRef FS)
Definition: VESubtarget.cpp:28
llvm::Triple::isOSLinux
bool isOSLinux() const
Tests whether the OS is Linux.
Definition: Triple.h:595
VEInstrInfo.h
VEISelLowering.h
llvm::VESubtarget::VESubtarget
VESubtarget(const Triple &TT, const std::string &CPU, const std::string &FS, const TargetMachine &TM)
Definition: VESubtarget.cpp:44
llvm::VESubtarget::getAdjustedFrameSize
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
VEGenSubtargetInfo
llvm::VESubtarget::getTargetLowering
const VETargetLowering * getTargetLowering() const override
Definition: VESubtarget.h:58
llvm::SelectionDAGTargetInfo
Targets can subclass this to parameterize the SelectionDAG lowering and instruction selection process...
Definition: SelectionDAGTargetInfo.h:31
llvm::VESubtarget::getRsaSize
unsigned getRsaSize(void) const
Get the size of RSA, return address, and frame pointer as described in VEFrameLowering....
Definition: VESubtarget.h:79
llvm::VEInstrInfo
Definition: VEInstrInfo.h:51
llvm::VESubtarget::enableMachineScheduler
bool enableMachineScheduler() const override
Definition: VESubtarget.cpp:61
uint64_t
llvm::TargetMachine
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:79
llvm::VEFrameLowering
Definition: VEFrameLowering.h:23
llvm::X86AS::FS
@ FS
Definition: X86.h:188
llvm::VESubtarget::getFrameLowering
const VEFrameLowering * getFrameLowering() const override
Definition: VESubtarget.h:52
DataLayout.h
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
VEFrameLowering.h
TargetSubtargetInfo.h
llvm::VESubtarget::getInstrInfo
const VEInstrInfo * getInstrInfo() const override
Definition: VESubtarget.h:51
llvm::VERegisterInfo
Definition: VERegisterInfo.h:22
SelectionDAGTargetInfo.h
llvm::VESubtarget
Definition: VESubtarget.h:31
TM
const char LLVMTargetMachineRef TM
Definition: PassBuilderBindings.cpp:47
llvm::VETargetLowering
Definition: VEISelLowering.h:50