LLVM 20.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"
14#include "llvm/IR/GlobalValue.h"
15#include "llvm/Support/Debug.h"
16
17#define DEBUG_TYPE "xtensa-subtarget"
18
19#define GET_SUBTARGETINFO_TARGET_DESC
20#define GET_SUBTARGETINFO_CTOR
21#include "XtensaGenSubtargetInfo.inc"
22
23using namespace llvm;
24
26XtensaSubtarget::initializeSubtargetDependencies(StringRef CPU, StringRef FS) {
27 StringRef CPUName = CPU;
28 if (CPUName.empty()) {
29 // set default cpu name
30 CPUName = "generic";
31 }
32
33 HasDensity = false;
34
35 // Parse features string.
36 ParseSubtargetFeatures(CPUName, CPUName, FS);
37 return *this;
38}
39
41 const TargetMachine &TM)
42 : XtensaGenSubtargetInfo(TT, CPU, /*TuneCPU=*/CPU, FS), TargetTriple(TT),
43 InstrInfo(initializeSubtargetDependencies(CPU, FS)), TLInfo(TM, *this),
44 TSInfo(), FrameLowering(*this) {}
const char LLVMTargetMachineRef TM
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
constexpr bool empty() const
empty - Check if the string is empty.
Definition: StringRef.h:134
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
XtensaSubtarget(const Triple &TT, StringRef CPU, StringRef FS, const TargetMachine &TM)
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18