LLVM 24.0.0git
XtensaTargetMachine.h
Go to the documentation of this file.
1//===-- XtensaTargetMachine.h - Define TargetMachine for Xtensa -*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
6// See https://llvm.org/LICENSE.txt for license information.
7// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8//
9//===----------------------------------------------------------------------===//
10//
11// This file declares the Xtensa specific subclass of TargetMachine.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_LIB_TARGET_XTENSA_XTENSATARGETMACHINE_H
16#define LLVM_LIB_TARGET_XTENSA_XTENSATARGETMACHINE_H
17
18#include "XtensaSubtarget.h"
21#include <optional>
22
23namespace llvm {
25
27 std::unique_ptr<TargetLoweringObjectFile> TLOF;
28public:
29 XtensaTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
31 std::optional<Reloc::Model> RM,
32 std::optional<CodeModel::Model> CM, CodeGenOptLevel OL,
33 bool JIT, bool isLittle);
34
35 XtensaTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
37 std::optional<Reloc::Model> RM,
38 std::optional<CodeModel::Model> CM, CodeGenOptLevel OL,
39 bool JIT);
40
41 const XtensaSubtarget *getSubtargetImpl(const Function &F) const override;
42
44
46 return TLOF.get();
47 }
48
51 const TargetSubtargetInfo *STI) const override;
52
53protected:
55
56 /// The attributes that select a subtarget.
59
60 bool operator==(const SubtargetAttrs &RHS) const {
61 return CPU == RHS.CPU && FS == RHS.FS;
62 }
63
64 bool operator!=(const SubtargetAttrs &RHS) const { return !(*this == RHS); }
65 };
67};
68} // end namespace llvm
69
70#endif // LLVM_LIB_TARGET_XTENSA_XTENSATARGETMACHINE_H
Cache of the last subtarget a TargetMachine returned, to skip building the subtarget key for consecut...
#define F(x, y, z)
Definition MD5.cpp:54
#define T
Basic Register Allocator
Value * RHS
Functions, function parameters, and return types can have attributes to indicate how they should be t...
Definition Attributes.h:106
CodeGenTargetMachineImpl(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM, CodeGenOptLevel OL)
Cache of the last subtarget returned by getSubtargetImpl.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Definition StringMap.h:129
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
std::unique_ptr< const MCSubtargetInfo > STI
TargetOptions Options
Target-Independent Code Generator Pass Configuration Options.
TargetSubtargetInfo - Generic base class for all target subtargets.
Target - Wrapper for Target specific information.
Triple - Helper class for working with autoconf configuration names.
Definition Triple.h:48
LastSubtargetCache< XtensaSubtarget, SubtargetAttrs > LastSubtarget
TargetPassConfig * createPassConfig(PassManagerBase &PM) override
Create a pass configuration object to be used by addPassToEmitX methods for generating a pipeline of ...
MachineFunctionInfo * createMachineFunctionInfo(BumpPtrAllocator &Allocator, const Function &F, const TargetSubtargetInfo *STI) const override
Create the target's instance of MachineFunctionInfo.
StringMap< std::unique_ptr< XtensaSubtarget > > SubtargetMap
TargetLoweringObjectFile * getObjFileLowering() const override
XtensaTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, std::optional< Reloc::Model > RM, std::optional< CodeModel::Model > CM, CodeGenOptLevel OL, bool JIT, bool isLittle)
const XtensaSubtarget * getSubtargetImpl(const Function &F) const override
Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInf...
PassManagerBase - An abstract interface to allow code to add passes to a pass manager without having ...
This is an optimization pass for GlobalISel generic memory operations.
CodeGenOptLevel
Code generation optimization level.
Definition CodeGen.h:280
Target TheXtensaTarget
BumpPtrAllocatorImpl<> BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
Definition Allocator.h:391
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
The attributes that select a subtarget.
bool operator!=(const SubtargetAttrs &RHS) const
bool operator==(const SubtargetAttrs &RHS) const