LLVM 20.0.0git
SPIRVMCTargetDesc.cpp
Go to the documentation of this file.
1//===-- SPIRVMCTargetDesc.cpp - SPIR-V Target Descriptions ----*- 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 provides SPIR-V specific target descriptions.
10//
11//===----------------------------------------------------------------------===//
12
13#include "SPIRVMCTargetDesc.h"
14#include "SPIRVInstPrinter.h"
15#include "SPIRVMCAsmInfo.h"
16#include "SPIRVTargetStreamer.h"
19#include "llvm/MC/MCInstrInfo.h"
23
24#define GET_INSTRINFO_MC_DESC
25#define ENABLE_INSTR_PREDICATE_VERIFIER
26#include "SPIRVGenInstrInfo.inc"
27
28#define GET_SUBTARGETINFO_MC_DESC
29#include "SPIRVGenSubtargetInfo.inc"
30
31#define GET_REGINFO_MC_DESC
32#include "SPIRVGenRegisterInfo.inc"
33
34using namespace llvm;
35
37 MCInstrInfo *X = new MCInstrInfo();
38 InitSPIRVMCInstrInfo(X);
39 return X;
40}
41
44 return X;
45}
46
47static MCSubtargetInfo *
49 return createSPIRVMCSubtargetInfoImpl(TT, CPU, /*TuneCPU*/ CPU, FS);
50}
51
54 MCInstPrinter *) {
55 return new SPIRVTargetStreamer(S);
56}
57
59 unsigned SyntaxVariant,
60 const MCAsmInfo &MAI,
61 const MCInstrInfo &MII,
62 const MCRegisterInfo &MRI) {
63 assert(SyntaxVariant == 0);
64 return new SPIRVInstPrinter(MAI, MII, MRI);
65}
66
67namespace {
68
69class SPIRVMCInstrAnalysis : public MCInstrAnalysis {
70public:
71 explicit SPIRVMCInstrAnalysis(const MCInstrInfo *Info)
73};
74
75} // end anonymous namespace
76
78 return new SPIRVMCInstrAnalysis(Info);
79}
80
93 }
94}
unsigned const MachineRegisterInfo * MRI
Analysis containing CSE Info
Definition: CSEInfo.cpp:27
#define LLVM_EXTERNAL_VISIBILITY
Definition: Compiler.h:131
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static MCInstrAnalysis * createSPIRVInstrAnalysis(const MCInstrInfo *Info)
static MCTargetStreamer * createTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &, MCInstPrinter *)
static MCInstrInfo * createSPIRVMCInstrInfo()
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeSPIRVTargetMC()
static MCSubtargetInfo * createSPIRVMCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS)
static MCRegisterInfo * createSPIRVMCRegisterInfo(const Triple &TT)
static MCInstPrinter * createSPIRVMCInstPrinter(const Triple &T, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI)
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:56
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
Definition: MCInstPrinter.h:45
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:26
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Streaming machine code generation interface.
Definition: MCStreamer.h:213
Generic base class for all target subtargets.
Target specific streamer interface.
Definition: MCStreamer.h:94
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
Target - Wrapper for Target specific information.
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
formatted_raw_ostream - A raw_ostream that wraps another one and keeps track of line and column posit...
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
MCCodeEmitter * createSPIRVMCCodeEmitter(const MCInstrInfo &MCII, MCContext &Ctx)
Target & getTheSPIRV32Target()
Target & getTheSPIRV64Target()
Target & getTheSPIRVLogicalTarget()
MCAsmBackend * createSPIRVAsmBackend(const Target &T, const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options)
RegisterMCAsmInfo - Helper template for registering a target assembly info implementation.
static void RegisterMCRegInfo(Target &T, Target::MCRegInfoCtorFnTy Fn)
RegisterMCRegInfo - Register a MCRegisterInfo implementation for the given target.
static void RegisterMCAsmBackend(Target &T, Target::MCAsmBackendCtorTy Fn)
RegisterMCAsmBackend - Register a MCAsmBackend implementation for the given target.
static void RegisterMCCodeEmitter(Target &T, Target::MCCodeEmitterCtorTy Fn)
RegisterMCCodeEmitter - Register a MCCodeEmitter implementation for the given target.
static void RegisterMCSubtargetInfo(Target &T, Target::MCSubtargetInfoCtorFnTy Fn)
RegisterMCSubtargetInfo - Register a MCSubtargetInfo implementation for the given target.
static void RegisterMCInstrAnalysis(Target &T, Target::MCInstrAnalysisCtorFnTy Fn)
RegisterMCInstrAnalysis - Register a MCInstrAnalysis implementation for the given target.
static void RegisterMCInstPrinter(Target &T, Target::MCInstPrinterCtorTy Fn)
RegisterMCInstPrinter - Register a MCInstPrinter implementation for the given target.
static void RegisterMCInstrInfo(Target &T, Target::MCInstrInfoCtorFnTy Fn)
RegisterMCInstrInfo - Register a MCInstrInfo implementation for the given target.
static void RegisterAsmTargetStreamer(Target &T, Target::AsmTargetStreamerCtorTy Fn)