LLVM  14.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 #include "Lanai.h"
16 
17 #define DEBUG_TYPE "lanai-subtarget"
18 
19 #define GET_SUBTARGETINFO_TARGET_DESC
20 #define GET_SUBTARGETINFO_CTOR
21 #include "LanaiGenSubtargetInfo.inc"
22 
23 using namespace llvm;
24 
26  std::string CPUName = std::string(CPU);
27  if (CPUName.empty())
28  CPUName = "generic";
29 
30  ParseSubtargetFeatures(CPUName, /*TuneCPU*/ CPUName, FS);
31 }
32 
34  StringRef FS) {
36  return *this;
37 }
38 
40  StringRef FeatureString, const TargetMachine &TM,
41  const TargetOptions & /*Options*/,
42  CodeModel::Model /*CodeModel*/,
43  CodeGenOpt::Level /*OptLevel*/)
44  : LanaiGenSubtargetInfo(TargetTriple, Cpu, /*TuneCPU*/ Cpu, FeatureString),
45  FrameLowering(initializeSubtargetDependencies(Cpu, FeatureString)),
46  InstrInfo(), TLInfo(TM, *this), TSInfo() {}
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::LanaiSubtarget::initSubtargetFeatures
void initSubtargetFeatures(StringRef CPU, StringRef FS)
Definition: LanaiSubtarget.cpp:25
LanaiGenSubtargetInfo
llvm::LanaiSubtarget::ParseSubtargetFeatures
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
llvm::TargetOptions
Definition: TargetOptions.h:124
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:45
Lanai.h
llvm::LanaiSubtarget::LanaiSubtarget
LanaiSubtarget(const Triple &TargetTriple, StringRef Cpu, StringRef FeatureString, const TargetMachine &TM, const TargetOptions &Options, CodeModel::Model CodeModel, CodeGenOpt::Level OptLevel)
Definition: LanaiSubtarget.cpp:39
llvm::X86AS::FS
@ FS
Definition: X86.h:188
llvm::CodeModel::Model
Model
Definition: CodeGen.h:28
llvm::TargetMachine
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:79
llvm::LanaiSubtarget::initializeSubtargetDependencies
LanaiSubtarget & initializeSubtargetDependencies(StringRef CPU, StringRef FS)
Definition: LanaiSubtarget.cpp:33
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
this
Analysis the ScalarEvolution expression for r is this
Definition: README.txt:8
llvm::LanaiSubtarget
Definition: LanaiSubtarget.h:29
llvm::CodeGenOpt::Level
Level
Definition: CodeGen.h:52
TM
const char LLVMTargetMachineRef TM
Definition: PassBuilderBindings.cpp:47
LanaiSubtarget.h