1 //===- XtensaSubtarget.cpp - Xtensa Subtarget Information -----------------===//
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
7 //===----------------------------------------------------------------------===//
9 // This file implements the Xtensa specific subclass of TargetSubtargetInfo.
11 //===----------------------------------------------------------------------===//
13 #include "XtensaSubtarget.h"
14 #include "llvm/IR/GlobalValue.h"
15 #include "llvm/Support/Debug.h"
17 #define DEBUG_TYPE "xtensa-subtarget"
19 #define GET_SUBTARGETINFO_TARGET_DESC
20 #define GET_SUBTARGETINFO_CTOR
21 #include "XtensaGenSubtargetInfo.inc"
26 XtensaSubtarget::initializeSubtargetDependencies(StringRef CPU
, StringRef FS
) {
27 StringRef CPUName
= CPU
;
28 if (CPUName
.empty()) {
29 // set default cpu name
35 // Parse features string.
36 ParseSubtargetFeatures(CPUName
, CPUName
, FS
);
40 XtensaSubtarget::XtensaSubtarget(const Triple
&TT
, StringRef CPU
, StringRef FS
,
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) {}