1 //===-- VESubtarget.cpp - VE Subtarget Information ------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 // This file implements the VE specific subclass of TargetSubtargetInfo.
11 //===----------------------------------------------------------------------===//
13 #include "VESubtarget.h"
14 #include "llvm/MC/TargetRegistry.h"
18 #define DEBUG_TYPE "ve-subtarget"
20 #define GET_SUBTARGETINFO_TARGET_DESC
21 #define GET_SUBTARGETINFO_CTOR
22 #include "VEGenSubtargetInfo.inc"
24 void VESubtarget::anchor() {}
26 VESubtarget
&VESubtarget::initializeSubtargetDependencies(StringRef CPU
,
28 // Default feature settings
31 // Determine default and user specified characteristics
32 std::string CPUName
= std::string(CPU
);
36 // Parse features string.
37 ParseSubtargetFeatures(CPUName
, /*TuneCPU=*/CPU
, FS
);
42 VESubtarget::VESubtarget(const Triple
&TT
, const std::string
&CPU
,
43 const std::string
&FS
, const TargetMachine
&TM
)
44 : VEGenSubtargetInfo(TT
, CPU
, /*TuneCPU=*/CPU
, FS
), TargetTriple(TT
),
45 InstrInfo(initializeSubtargetDependencies(CPU
, FS
)), TLInfo(TM
, *this),
46 FrameLowering(*this) {}
48 uint64_t VESubtarget::getAdjustedFrameSize(uint64_t FrameSize
) const {
49 // Calculate adjusted frame size by adding the size of RSA frame,
50 // return address, and frame poitner as described in VEFrameLowering.cpp.
51 const VEFrameLowering
*TFL
= getFrameLowering();
53 FrameSize
+= getRsaSize();
54 FrameSize
= alignTo(FrameSize
, TFL
->getStackAlign());
59 bool VESubtarget::enableMachineScheduler() const { return true; }