Path: blob/main/contrib/llvm-project/llvm/lib/Target/VE/VESubtarget.h
35267 views
//===-- VESubtarget.h - Define Subtarget for the VE -------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This file declares the VE specific subclass of TargetSubtargetInfo.9//10//===----------------------------------------------------------------------===//1112#ifndef LLVM_LIB_TARGET_VE_VESUBTARGET_H13#define LLVM_LIB_TARGET_VE_VESUBTARGET_H1415#include "VEFrameLowering.h"16#include "VEISelLowering.h"17#include "VEInstrInfo.h"18#include "llvm/CodeGen/SelectionDAGTargetInfo.h"19#include "llvm/CodeGen/TargetFrameLowering.h"20#include "llvm/CodeGen/TargetSubtargetInfo.h"21#include "llvm/IR/DataLayout.h"22#include <string>2324#define GET_SUBTARGETINFO_HEADER25#include "VEGenSubtargetInfo.inc"2627namespace llvm {28class StringRef;2930class VESubtarget : public VEGenSubtargetInfo {31Triple TargetTriple;32virtual void anchor();3334/// Features {3536// Emit VPU instructions37bool EnableVPU;3839/// } Features4041VEInstrInfo InstrInfo;42VETargetLowering TLInfo;43SelectionDAGTargetInfo TSInfo;44VEFrameLowering FrameLowering;4546public:47VESubtarget(const Triple &TT, const std::string &CPU, const std::string &FS,48const TargetMachine &TM);4950const VEInstrInfo *getInstrInfo() const override { return &InstrInfo; }51const VEFrameLowering *getFrameLowering() const override {52return &FrameLowering;53}54const VERegisterInfo *getRegisterInfo() const override {55return &InstrInfo.getRegisterInfo();56}57const VETargetLowering *getTargetLowering() const override { return &TLInfo; }58const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {59return &TSInfo;60}6162bool enableMachineScheduler() const override;6364bool enableVPU() const { return EnableVPU; }6566/// ParseSubtargetFeatures - Parses features string setting specified67/// subtarget options. Definition of function is auto generated by tblgen.68void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS);69VESubtarget &initializeSubtargetDependencies(StringRef CPU, StringRef FS);7071/// Given a actual stack size as determined by FrameInfo, this function72/// returns adjusted framesize which includes space for RSA, return73/// address, and frame poitner.74uint64_t getAdjustedFrameSize(uint64_t FrameSize) const;7576/// Get the size of RSA, return address, and frame pointer as described77/// in VEFrameLowering.cpp.78unsigned getRsaSize() const { return 176; };7980bool isTargetLinux() const { return TargetTriple.isOSLinux(); }81};8283} // namespace llvm8485#endif868788