Revert " [LoongArch][ISel] Check the number of sign bits in `PatGprGpr_32` (#107432)"
[llvm-project.git] / llvm / lib / Target / Lanai / LanaiSubtarget.cpp
blob11cd7f53505e3f476e1dd41ba6a407c98cfe6b8d
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.
11 //===----------------------------------------------------------------------===//
13 #include "LanaiSubtarget.h"
15 #include "Lanai.h"
17 #define DEBUG_TYPE "lanai-subtarget"
19 #define GET_SUBTARGETINFO_TARGET_DESC
20 #define GET_SUBTARGETINFO_CTOR
21 #include "LanaiGenSubtargetInfo.inc"
23 using namespace llvm;
25 void LanaiSubtarget::initSubtargetFeatures(StringRef CPU, StringRef FS) {
26 std::string CPUName = std::string(CPU);
27 if (CPUName.empty())
28 CPUName = "generic";
30 ParseSubtargetFeatures(CPUName, /*TuneCPU*/ CPUName, FS);
33 LanaiSubtarget &LanaiSubtarget::initializeSubtargetDependencies(StringRef CPU,
34 StringRef FS) {
35 initSubtargetFeatures(CPU, FS);
36 return *this;
39 LanaiSubtarget::LanaiSubtarget(const Triple &TargetTriple, StringRef Cpu,
40 StringRef FeatureString, const TargetMachine &TM,
41 const TargetOptions & /*Options*/,
42 CodeModel::Model /*CodeModel*/,
43 CodeGenOptLevel /*OptLevel*/)
44 : LanaiGenSubtargetInfo(TargetTriple, Cpu, /*TuneCPU*/ Cpu, FeatureString),
45 FrameLowering(initializeSubtargetDependencies(Cpu, FeatureString)),
46 TLInfo(TM, *this) {}