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"
15 #include "llvm/Support/MathExtras.h"
16 #include "llvm/Support/TargetRegistry.h"
20 #define DEBUG_TYPE "ve-subtarget"
22 #define GET_SUBTARGETINFO_TARGET_DESC
23 #define GET_SUBTARGETINFO_CTOR
24 #include "VEGenSubtargetInfo.inc"
26 void VESubtarget::anchor() {}
28 VESubtarget
&VESubtarget::initializeSubtargetDependencies(StringRef CPU
,
30 // Default feature settings
33 // Determine default and user specified characteristics
34 std::string CPUName
= std::string(CPU
);
38 // Parse features string.
39 ParseSubtargetFeatures(CPUName
, /*TuneCPU=*/CPU
, FS
);
44 VESubtarget::VESubtarget(const Triple
&TT
, const std::string
&CPU
,
45 const std::string
&FS
, const TargetMachine
&TM
)
46 : VEGenSubtargetInfo(TT
, CPU
, /*TuneCPU=*/CPU
, FS
), TargetTriple(TT
),
47 InstrInfo(initializeSubtargetDependencies(CPU
, FS
)), TLInfo(TM
, *this),
48 FrameLowering(*this) {}
50 uint64_t VESubtarget::getAdjustedFrameSize(uint64_t FrameSize
) const {
51 // Calculate adjusted frame size by adding the size of RSA frame,
52 // return address, and frame poitner as described in VEFrameLowering.cpp.
53 const VEFrameLowering
*TFL
= getFrameLowering();
55 FrameSize
+= getRsaSize();
56 FrameSize
= alignTo(FrameSize
, TFL
->getStackAlign());
61 bool VESubtarget::enableMachineScheduler() const { return true; }