LLVM 20.0.0git
LanaiSubtarget.cpp
Go to the documentation of this file.
1//===- LanaiSubtarget.cpp - Lanai Subtarget Information -----------*- 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 implements the Lanai specific subclass of TargetSubtarget.
10//
11//===----------------------------------------------------------------------===//
12
13#include "LanaiSubtarget.h"
14
15#define DEBUG_TYPE "lanai-subtarget"
16
17#define GET_SUBTARGETINFO_TARGET_DESC
18#define GET_SUBTARGETINFO_CTOR
19#include "LanaiGenSubtargetInfo.inc"
20
21using namespace llvm;
22
24 std::string CPUName = std::string(CPU);
25 if (CPUName.empty())
26 CPUName = "generic";
27
28 ParseSubtargetFeatures(CPUName, /*TuneCPU*/ CPUName, FS);
29}
30
32 StringRef FS) {
33 initSubtargetFeatures(CPU, FS);
34 return *this;
35}
36
38 StringRef FeatureString, const TargetMachine &TM,
39 const TargetOptions & /*Options*/,
40 CodeModel::Model /*CodeModel*/,
41 CodeGenOptLevel /*OptLevel*/)
42 : LanaiGenSubtargetInfo(TargetTriple, Cpu, /*TuneCPU*/ Cpu, FeatureString),
43 FrameLowering(initializeSubtargetDependencies(Cpu, FeatureString)),
44 TLInfo(TM, *this) {}
LanaiSubtarget(const Triple &TargetTriple, StringRef Cpu, StringRef FeatureString, const TargetMachine &TM, const TargetOptions &Options, CodeModel::Model CodeModel, CodeGenOptLevel OptLevel)
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
void initSubtargetFeatures(StringRef CPU, StringRef FS)
LanaiSubtarget & initializeSubtargetDependencies(StringRef CPU, StringRef FS)
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:51
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:77
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
CodeGenOptLevel
Code generation optimization level.
Definition: CodeGen.h:54