Path: blob/main/contrib/llvm-project/llvm/lib/Target/VE/VESubtarget.cpp
35269 views
//===-- VESubtarget.cpp - VE Subtarget Information ------------------------===//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 implements the VE specific subclass of TargetSubtargetInfo.9//10//===----------------------------------------------------------------------===//1112#include "VESubtarget.h"13#include "VE.h"14#include "llvm/MC/TargetRegistry.h"15#include "llvm/Support/MathExtras.h"1617using namespace llvm;1819#define DEBUG_TYPE "ve-subtarget"2021#define GET_SUBTARGETINFO_TARGET_DESC22#define GET_SUBTARGETINFO_CTOR23#include "VEGenSubtargetInfo.inc"2425void VESubtarget::anchor() {}2627VESubtarget &VESubtarget::initializeSubtargetDependencies(StringRef CPU,28StringRef FS) {29// Default feature settings30EnableVPU = false;3132// Determine default and user specified characteristics33std::string CPUName = std::string(CPU);34if (CPUName.empty())35CPUName = "generic";3637// Parse features string.38ParseSubtargetFeatures(CPUName, /*TuneCPU=*/CPU, FS);3940return *this;41}4243VESubtarget::VESubtarget(const Triple &TT, const std::string &CPU,44const std::string &FS, const TargetMachine &TM)45: VEGenSubtargetInfo(TT, CPU, /*TuneCPU=*/CPU, FS), TargetTriple(TT),46InstrInfo(initializeSubtargetDependencies(CPU, FS)), TLInfo(TM, *this),47FrameLowering(*this) {}4849uint64_t VESubtarget::getAdjustedFrameSize(uint64_t FrameSize) const {50// Calculate adjusted frame size by adding the size of RSA frame,51// return address, and frame poitner as described in VEFrameLowering.cpp.52const VEFrameLowering *TFL = getFrameLowering();5354FrameSize += getRsaSize();55FrameSize = alignTo(FrameSize, TFL->getStackAlign());5657return FrameSize;58}5960bool VESubtarget::enableMachineScheduler() const { return true; }616263