LLVM 22.0.0git
XtensaSubtarget.cpp
Go to the documentation of this file.
1//===- XtensaSubtarget.cpp - Xtensa Subtarget Information -----------------===//
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 Xtensa specific subclass of TargetSubtargetInfo.
10//
11//===----------------------------------------------------------------------===//
12
13#include "XtensaSubtarget.h"
15#include "llvm/IR/GlobalValue.h"
16#include "llvm/Support/Debug.h"
17
18#define DEBUG_TYPE "xtensa-subtarget"
19
20#define GET_SUBTARGETINFO_TARGET_DESC
21#define GET_SUBTARGETINFO_CTOR
22#include "XtensaGenSubtargetInfo.inc"
23
24using namespace llvm;
25
27XtensaSubtarget::initializeSubtargetDependencies(StringRef CPU, StringRef FS) {
28 StringRef CPUName = CPU;
29 if (CPUName.empty()) {
30 // set default cpu name
31 CPUName = "generic";
32 }
33
34 // Parse features string.
35 ParseSubtargetFeatures(CPUName, CPUName, FS);
36 return *this;
37}
38
40 const TargetMachine &TM)
41 : XtensaGenSubtargetInfo(TT, CPU, /*TuneCPU=*/CPU, FS), TargetTriple(TT),
42 InstrInfo(initializeSubtargetDependencies(CPU, FS)), TLInfo(TM, *this),
43 FrameLowering(*this) {
44 TSInfo = std::make_unique<SelectionDAGTargetInfo>();
45}
46
48
50 return TSInfo.get();
51}
Targets can subclass this to parameterize the SelectionDAG lowering and instruction selection process...
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
constexpr bool empty() const
empty - Check if the string is empty.
Definition StringRef.h:143
Primary interface to the complete machine description for the target machine.
Triple - Helper class for working with autoconf configuration names.
Definition Triple.h:47
XtensaSubtarget(const Triple &TT, StringRef CPU, StringRef FS, const TargetMachine &TM)
~XtensaSubtarget() override
const SelectionDAGTargetInfo * getSelectionDAGInfo() const override
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
This is an optimization pass for GlobalISel generic memory operations.