LLVM  10.0.0
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  VEInstrInfo InstrInfo;
36  VETargetLowering TLInfo;
38  VEFrameLowering FrameLowering;
39 
40 public:
41  VESubtarget(const Triple &TT, const std::string &CPU, const std::string &FS,
42  const TargetMachine &TM);
43 
44  const VEInstrInfo *getInstrInfo() const override { return &InstrInfo; }
45  const TargetFrameLowering *getFrameLowering() const override {
46  return &FrameLowering;
47  }
48  const VERegisterInfo *getRegisterInfo() const override {
49  return &InstrInfo.getRegisterInfo();
50  }
51  const VETargetLowering *getTargetLowering() const override { return &TLInfo; }
52  const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
53  return &TSInfo;
54  }
55 
56  bool enableMachineScheduler() const override;
57 
58  /// ParseSubtargetFeatures - Parses features string setting specified
59  /// subtarget options. Definition of function is auto generated by tblgen.
62 
63  /// Given a actual stack size as determined by FrameInfo, this function
64  /// returns adjusted framesize which includes space for register window
65  /// spills and arguments.
66  int getAdjustedFrameSize(int stackSize) const;
67 
68  bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
69 };
70 
71 } // namespace llvm
72 
73 #endif
This class represents lattice values for constants.
Definition: AllocatorList.h:23
const VERegisterInfo * getRegisterInfo() const override
Definition: VESubtarget.h:48
VESubtarget & initializeSubtargetDependencies(StringRef CPU, StringRef FS)
Definition: VESubtarget.cpp:28
bool isTargetLinux() const
Definition: VESubtarget.h:68
const VEInstrInfo * getInstrInfo() const override
Definition: VESubtarget.h:44
const TargetFrameLowering * getFrameLowering() const override
Definition: VESubtarget.h:45
Targets can subclass this to parameterize the SelectionDAG lowering and instruction selection process...
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:43
const VERegisterInfo & getRegisterInfo() const
getRegisterInfo - TargetInstrInfo is a superset of MRegister info.
Definition: VEInstrInfo.h:38
Information about stack frame layout on the target.
bool isOSLinux() const
Tests whether the OS is Linux.
Definition: Triple.h:587
int getAdjustedFrameSize(int stackSize) const
Given a actual stack size as determined by FrameInfo, this function returns adjusted framesize which ...
Definition: VESubtarget.cpp:47
const SelectionDAGTargetInfo * getSelectionDAGInfo() const override
Definition: VESubtarget.h:52
bool enableMachineScheduler() const override
Definition: VESubtarget.cpp:99
VESubtarget(const Triple &TT, const std::string &CPU, const std::string &FS, const TargetMachine &TM)
Definition: VESubtarget.cpp:41
const VETargetLowering * getTargetLowering() const override
Definition: VESubtarget.h:51
void ParseSubtargetFeatures(StringRef CPU, StringRef FS)
ParseSubtargetFeatures - Parses features string setting specified subtarget options.
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:65
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:54