LLVM 22.0.0git
AMDKernelCodeTUtils.h
Go to the documentation of this file.
1//===- AMDGPUKernelCodeTUtils.h - helpers for amd_kernel_code_t -*- 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/// \file AMDKernelCodeTUtils.h
10/// MC layer struct for AMDGPUMCKernelCodeT, provides MCExpr functionality where
11/// required.
12///
13//
14//===----------------------------------------------------------------------===//
15
16#ifndef LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCKERNELCODET_H
17#define LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCKERNELCODET_H
18
19#include "AMDKernelCodeT.h"
20#include "llvm/ADT/ArrayRef.h"
21#include "llvm/ADT/StringRef.h"
22
23namespace llvm {
24class MCAsmParser;
25class MCContext;
26class MCExpr;
27class MCStreamer;
28class MCSubtargetInfo;
29class raw_ostream;
30class MCAsmInfo;
31namespace AMDGPU {
32
35
36 // Names of most (if not all) members should match the ones used for table
37 // driven (array) generation in AMDKernelCodeTInfo.h.
64 int32_t call_convention = 0;
65 uint8_t reserved3[12] = {0};
68
71
72 const MCExpr *is_dynamic_callstack = nullptr;
73 const MCExpr *wavefront_sgpr_count = nullptr;
74 const MCExpr *workitem_vgpr_count = nullptr;
76
77 void initDefault(const MCSubtargetInfo *STI, MCContext &Ctx,
78 bool InitMCExpr = true);
79 void validate(const MCSubtargetInfo *STI, MCContext &Ctx);
80
81 const MCExpr *&getMCExprForIndex(int Index);
82
84 function_ref<void(const MCExpr *, raw_ostream &, const MCAsmInfo *)>;
86 void EmitKernelCodeT(raw_ostream &OS, MCContext &Ctx, PrintHelper Helper);
87 void EmitKernelCodeT(MCStreamer &OS, MCContext &Ctx);
88};
89
90} // end namespace AMDGPU
91} // end namespace llvm
92
93#endif // LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCKERNELCODET_H
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition MCAsmInfo.h:64
Generic assembler parser interface, for use by target specific assembly parsers.
Context object for machine code objects.
Definition MCContext.h:83
Base class for the full range of assembler expressions which are needed for parsing.
Definition MCExpr.h:34
Streaming machine code generation interface.
Definition MCStreamer.h:220
Generic base class for all target subtargets.
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
An efficient, type-erasing, non-owning reference to a callable.
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition CallingConv.h:24
This is an optimization pass for GlobalISel generic memory operations.
function_ref< void(const MCExpr *, raw_ostream &, const MCAsmInfo *)> PrintHelper
void EmitKernelCodeT(raw_ostream &OS, MCContext &Ctx, PrintHelper Helper)
void validate(const MCSubtargetInfo *STI, MCContext &Ctx)
void initDefault(const MCSubtargetInfo *STI, MCContext &Ctx, bool InitMCExpr=true)
bool ParseKernelCodeT(StringRef ID, MCAsmParser &MCParser, raw_ostream &Err)
const MCExpr *& getMCExprForIndex(int Index)