LLVM 24.0.0git
AMDGPUPrintf.h
Go to the documentation of this file.
1//===- AMDGPUPrintf.h -------------------------------------------*- 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
10/// Helpers for the AMDGPU printf runtime interface, shared by the lowerings of
11/// printf calls on the AMDGPU target.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_SUPPORT_AMDGPUPRINTF_H
16#define LLVM_SUPPORT_AMDGPUPRINTF_H
17
20#include "llvm/ADT/StringRef.h"
22#include <cstdint>
23#include <string>
24
25namespace llvm {
26
27/// Marks the printf arguments that the format string \p Fmt specifies as
28/// strings, i.e. with a "%s" specifier. Argument 0 is the format string itself,
29/// and each '*' in a specifier consumes an argument of its own.
31
32/// Returns the ID that buffered printf stores in place of the constant format
33/// string \p Fmt the low 64 bits of its MD5 hash.
35
36/// Returns the llvm.printf.fmts entry that maps the ID of the constant format
37/// string \p Fmt back to the string.
39
40/// The llvm.printf.fmts entry added when a module only uses buffered printf
41/// with non-constant format strings.
43 "0:0:ffffffff,\"Non const format string\"";
44
45/// Splits the constant string argument \p Str, including its terminating NUL,
46/// into the little-endian 32-bit words that buffered printf stores for it,
47/// padded to a multiple of 8 bytes.
50
51} // end namespace llvm
52
53#endif // LLVM_SUPPORT_AMDGPUPRINTF_H
uint64_t uint64_t
#define LLVM_ABI
Definition Compiler.h:211
This file defines the SmallVector class.
This file defines the SparseBitVector class.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
Definition StringRef.h:888
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI std::string getAMDGPUPrintfFormatMetadata(StringRef Fmt)
Returns the llvm.printf.fmts entry that maps the ID of the constant format string Fmt back to the str...
LLVM_ABI uint64_t getAMDGPUPrintfFormatHash(StringRef Fmt)
Returns the ID that buffered printf stores in place of the constant format string Fmt the low 64 bits...
LLVM_ABI void locateAMDGPUPrintfCStrings(SparseBitVector< 8 > &BV, StringRef Fmt)
Marks the printf arguments that the format string Fmt specifies as strings, i.e.
LLVM_ABI void packAMDGPUPrintfConstantString(StringRef Str, SmallVectorImpl< uint32_t > &Words)
Splits the constant string argument Str, including its terminating NUL, into the little-endian 32-bit...
constexpr StringLiteral AMDGPUPrintfNonConstFormatMetadata
The llvm.printf.fmts entry added when a module only uses buffered printf with non-constant format str...