rocm.bindings.llvm.c.remarks#

2026-09-24

12 min read time

Applies to Linux and Windows

Advanced Micro Devices, Inc.

Attributes#

Classes#

LLVMRemarkType

The type of the emitted remark.

LLVMRemarkOpaqueString

(No short description)

LLVMRemarkOpaqueDebugLoc

(No short description)

LLVMRemarkOpaqueArg

(No short description)

LLVMRemarkOpaqueEntry

(No short description)

LLVMRemarkOpaqueParser

(No short description)

Functions#

has_symbol(→ bool)

LLVMRemarkStringGetData(String)

Returns the buffer holding the string.

LLVMRemarkStringGetLen(String)

Returns the size of the string.

LLVMRemarkDebugLocGetSourceFilePath(DL)

Return the path to the source file for a debug location.

LLVMRemarkDebugLocGetSourceLine(DL)

Return the line in the source file for a debug location.

LLVMRemarkDebugLocGetSourceColumn(DL)

Return the column in the source file for a debug location.

LLVMRemarkArgGetKey(Arg)

Returns the key of an argument.

LLVMRemarkArgGetValue(Arg)

Returns the value of an argument. This is a string that can contain newlines.

LLVMRemarkArgGetDebugLoc(Arg)

Returns the debug location that is attached to the value of this argument.

LLVMRemarkEntryDispose(Remark)

Free the resources used by the remark entry.

LLVMRemarkEntryGetType(Remark)

The type of the remark.

LLVMRemarkEntryGetPassName(Remark)

Get the name of the pass that emitted this remark.

LLVMRemarkEntryGetRemarkName(Remark)

Get an identifier of the remark.

LLVMRemarkEntryGetFunctionName(Remark)

Get the name of the function being processed when the remark was emitted.

LLVMRemarkEntryGetDebugLoc(Remark)

Returns the debug location that is attached to this remark.

LLVMRemarkEntryGetHotness(Remark)

Return the hotness of the remark.

LLVMRemarkEntryGetNumArgs(Remark)

The number of arguments the remark holds.

LLVMRemarkEntryGetFirstArg(Remark)

Get a new iterator to iterate over a remark's argument.

LLVMRemarkEntryGetNextArg(It, Remark)

Get the next argument in Remark from the position of It.

LLVMRemarkParserCreateYAML(Buf, Size)

Creates a remark parser that can be used to parse the buffer located in p

LLVMRemarkParserCreateBitstream(Buf, Size)

Creates a remark parser that can be used to parse the buffer located in p

LLVMRemarkParserGetNext(Parser)

Returns the next remark in the file.

LLVMRemarkParserHasError(Parser)

Returns 1 if the parser encountered an error while parsing the buffer.

LLVMRemarkParserGetErrorMessage(Parser)

Returns a null-terminated string containing an error message.

LLVMRemarkParserDispose(Parser)

Releases all the resources used by Parser.

LLVMRemarkVersion()

Returns the version of the remarks library.

Module Contents#

rocm.bindings.llvm.c.remarks.has_symbol(name: str | bytes | bytearray) → bool#
class rocm.bindings.llvm.c.remarks.LLVMRemarkType#

Bases: enum.IntEnum

The type of the emitted remark.

LLVMRemarkTypeUnknown: int#
LLVMRemarkTypePassed: int#
LLVMRemarkTypeMissed: int#
LLVMRemarkTypeAnalysis: int#
LLVMRemarkTypeAnalysisFPCommute: int#
LLVMRemarkTypeAnalysisAliasing: int#
LLVMRemarkTypeFailure: int#
class rocm.bindings.llvm.c.remarks.LLVMRemarkOpaqueString(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

rocm.bindings.llvm.c.remarks.LLVMRemarkStringRef#
rocm.bindings.llvm.c.remarks.LLVMRemarkStringGetData(String)#

Returns the buffer holding the string.

Since:

REMARKS_API_VERSION=0

Args:
String (LLVMRemarkOpaqueString/object):

(undocumented)

Returns:

bytes: (undocumented)

C signature

const char * LLVMRemarkStringGetData(LLVMRemarkStringRef String)
rocm.bindings.llvm.c.remarks.LLVMRemarkStringGetLen(String)#

Returns the size of the string.

Since:

REMARKS_API_VERSION=0

Args:
String (LLVMRemarkOpaqueString/object):

(undocumented)

Returns:

int: (undocumented)

C signature

uint32_t LLVMRemarkStringGetLen(LLVMRemarkStringRef String)
class rocm.bindings.llvm.c.remarks.LLVMRemarkOpaqueDebugLoc(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

rocm.bindings.llvm.c.remarks.LLVMRemarkDebugLocRef#
rocm.bindings.llvm.c.remarks.LLVMRemarkDebugLocGetSourceFilePath(DL)#

Return the path to the source file for a debug location.

Since:

REMARKS_API_VERSION=0

Args:
DL (LLVMRemarkOpaqueDebugLoc/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMRemarkStringRef LLVMRemarkDebugLocGetSourceFilePath(LLVMRemarkDebugLocRef DL)
rocm.bindings.llvm.c.remarks.LLVMRemarkDebugLocGetSourceLine(DL)#

Return the line in the source file for a debug location.

Since:

REMARKS_API_VERSION=0

Args:
DL (LLVMRemarkOpaqueDebugLoc/object):

(undocumented)

Returns:

int: (undocumented)

C signature

uint32_t LLVMRemarkDebugLocGetSourceLine(LLVMRemarkDebugLocRef DL)
rocm.bindings.llvm.c.remarks.LLVMRemarkDebugLocGetSourceColumn(DL)#

Return the column in the source file for a debug location.

Since:

REMARKS_API_VERSION=0

Args:
DL (LLVMRemarkOpaqueDebugLoc/object):

(undocumented)

Returns:

int: (undocumented)

C signature

uint32_t LLVMRemarkDebugLocGetSourceColumn(LLVMRemarkDebugLocRef DL)
class rocm.bindings.llvm.c.remarks.LLVMRemarkOpaqueArg(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

rocm.bindings.llvm.c.remarks.LLVMRemarkArgRef#
rocm.bindings.llvm.c.remarks.LLVMRemarkArgGetKey(Arg)#

Returns the key of an argument.

The key defines what the value is, and the same key can appear multiple times in the list of arguments.

Since:

REMARKS_API_VERSION=0

Args:
Arg (LLVMRemarkOpaqueArg/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMRemarkStringRef LLVMRemarkArgGetKey(LLVMRemarkArgRef Arg)
rocm.bindings.llvm.c.remarks.LLVMRemarkArgGetValue(Arg)#

Returns the value of an argument. This is a string that can contain newlines.

Since:

REMARKS_API_VERSION=0

Args:
Arg (LLVMRemarkOpaqueArg/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMRemarkStringRef LLVMRemarkArgGetValue(LLVMRemarkArgRef Arg)
rocm.bindings.llvm.c.remarks.LLVMRemarkArgGetDebugLoc(Arg)#

Returns the debug location that is attached to the value of this argument.

If there is no debug location, the return value will be NULL.

Since:

REMARKS_API_VERSION=0

Args:
Arg (LLVMRemarkOpaqueArg/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMRemarkDebugLocRef LLVMRemarkArgGetDebugLoc(LLVMRemarkArgRef Arg)
class rocm.bindings.llvm.c.remarks.LLVMRemarkOpaqueEntry(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

rocm.bindings.llvm.c.remarks.LLVMRemarkEntryRef#
rocm.bindings.llvm.c.remarks.LLVMRemarkEntryDispose(Remark)#

Free the resources used by the remark entry.

Since:

REMARKS_API_VERSION=0

Args:
Remark (LLVMRemarkOpaqueEntry/object):

(undocumented)

C signature

void LLVMRemarkEntryDispose(LLVMRemarkEntryRef Remark)
rocm.bindings.llvm.c.remarks.LLVMRemarkEntryGetType(Remark)#

The type of the remark.

For example, it can allow users to only keep the missed optimizations from the compiler.

Since:

REMARKS_API_VERSION=0

Args:
Remark (LLVMRemarkOpaqueEntry/object):

(undocumented)

Returns:

LLVMRemarkType: (undocumented)

C signature

enum LLVMRemarkType LLVMRemarkEntryGetType(LLVMRemarkEntryRef Remark)
rocm.bindings.llvm.c.remarks.LLVMRemarkEntryGetPassName(Remark)#

Get the name of the pass that emitted this remark.

Since:

REMARKS_API_VERSION=0

Args:
Remark (LLVMRemarkOpaqueEntry/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMRemarkStringRef LLVMRemarkEntryGetPassName(LLVMRemarkEntryRef Remark)
rocm.bindings.llvm.c.remarks.LLVMRemarkEntryGetRemarkName(Remark)#

Get an identifier of the remark.

Since:

REMARKS_API_VERSION=0

Args:
Remark (LLVMRemarkOpaqueEntry/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMRemarkStringRef LLVMRemarkEntryGetRemarkName(LLVMRemarkEntryRef Remark)
rocm.bindings.llvm.c.remarks.LLVMRemarkEntryGetFunctionName(Remark)#

Get the name of the function being processed when the remark was emitted.

Since:

REMARKS_API_VERSION=0

Args:
Remark (LLVMRemarkOpaqueEntry/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMRemarkStringRef LLVMRemarkEntryGetFunctionName(LLVMRemarkEntryRef Remark)
rocm.bindings.llvm.c.remarks.LLVMRemarkEntryGetDebugLoc(Remark)#

Returns the debug location that is attached to this remark.

If there is no debug location, the return value will be NULL.

Since:

REMARKS_API_VERSION=0

Args:
Remark (LLVMRemarkOpaqueEntry/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMRemarkDebugLocRef LLVMRemarkEntryGetDebugLoc(LLVMRemarkEntryRef Remark)
rocm.bindings.llvm.c.remarks.LLVMRemarkEntryGetHotness(Remark)#

Return the hotness of the remark.

A hotness of 0 means this value is not set.

Since:

REMARKS_API_VERSION=0

Args:
Remark (LLVMRemarkOpaqueEntry/object):

(undocumented)

Returns:

int: (undocumented)

C signature

uint64_t LLVMRemarkEntryGetHotness(LLVMRemarkEntryRef Remark)
rocm.bindings.llvm.c.remarks.LLVMRemarkEntryGetNumArgs(Remark)#

The number of arguments the remark holds.

Since:

REMARKS_API_VERSION=0

Args:
Remark (LLVMRemarkOpaqueEntry/object):

(undocumented)

Returns:

int: (undocumented)

C signature

uint32_t LLVMRemarkEntryGetNumArgs(LLVMRemarkEntryRef Remark)
rocm.bindings.llvm.c.remarks.LLVMRemarkEntryGetFirstArg(Remark)#

Get a new iterator to iterate over a remark’s argument.

If there are no arguments in Remark, the return value will be NULL.

The lifetime of the returned value is bound to the lifetime of Remark.

Since:

REMARKS_API_VERSION=0

Args:
Remark (LLVMRemarkOpaqueEntry/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMRemarkArgRef LLVMRemarkEntryGetFirstArg(LLVMRemarkEntryRef Remark)
rocm.bindings.llvm.c.remarks.LLVMRemarkEntryGetNextArg(It, Remark)#

Get the next argument in Remark from the position of It.

Returns NULL if there are no more arguments available.

The lifetime of the returned value is bound to the lifetime of Remark.

Since:

REMARKS_API_VERSION=0

Args:
It (LLVMRemarkOpaqueArg/object):

(undocumented)

Remark (LLVMRemarkOpaqueEntry/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMRemarkArgRef LLVMRemarkEntryGetNextArg(LLVMRemarkArgRef It, LLVMRemarkEntryRef Remark)
class rocm.bindings.llvm.c.remarks.LLVMRemarkOpaqueParser(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

rocm.bindings.llvm.c.remarks.LLVMRemarkParserRef#
rocm.bindings.llvm.c.remarks.LLVMRemarkParserCreateYAML(Buf, Size)#

Creates a remark parser that can be used to parse the buffer located in p Buf of size Size bytes.

Buf cannot be NULL.

This function should be paired with LLVMRemarkParserDispose() to avoid leaking resources.

Since:

REMARKS_API_VERSION=0

Args:
Buf (Pointer/object):

(undocumented)

Size (int):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMRemarkParserRef LLVMRemarkParserCreateYAML(const void * Buf, uint64_t Size)
rocm.bindings.llvm.c.remarks.LLVMRemarkParserCreateBitstream(Buf, Size)#

Creates a remark parser that can be used to parse the buffer located in p Buf of size Size bytes.

Buf cannot be NULL.

This function should be paired with LLVMRemarkParserDispose() to avoid leaking resources.

Since:

REMARKS_API_VERSION=1

Args:
Buf (Pointer/object):

(undocumented)

Size (int):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMRemarkParserRef LLVMRemarkParserCreateBitstream(const void * Buf, uint64_t Size)
rocm.bindings.llvm.c.remarks.LLVMRemarkParserGetNext(Parser)#

Returns the next remark in the file.

The value pointed to by the return value needs to be disposed using a call to LLVMRemarkEntryDispose().

All the entries in the returned value that are of LLVMRemarkStringRef type will become invalidated once a call to LLVMRemarkParserDispose is made.

If the parser reaches the end of the buffer, the return value will be NULL.

In the case of an error, the return value will be NULL, and:

  1. LLVMRemarkParserHasError() will return 1.

  2. LLVMRemarkParserGetErrorMessage() will return a descriptive error message.

An error may occur if:

  1. An argument is invalid.

  2. There is a parsing error. This can occur on things like malformed YAML.

  3. There is a Remark semantic error. This can occur on well-formed files with missing or extra fields.

Here is a quick example of the usage:

``` LLVMRemarkParserRef Parser = LLVMRemarkParserCreateYAML(Buf, Size); LLVMRemarkEntryRef Remark = NULL; while ((Remark = LLVMRemarkParserGetNext(Parser))) {

// use Remark LLVMRemarkEntryDispose(Remark); // Release memory.

} bool HasError = LLVMRemarkParserHasError(Parser); LLVMRemarkParserDispose(Parser); ```

Since:

REMARKS_API_VERSION=0

Args:
Parser (LLVMRemarkOpaqueParser/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMRemarkEntryRef LLVMRemarkParserGetNext(LLVMRemarkParserRef Parser)
rocm.bindings.llvm.c.remarks.LLVMRemarkParserHasError(Parser)#

Returns 1 if the parser encountered an error while parsing the buffer.

Since:

REMARKS_API_VERSION=0

Args:
Parser (LLVMRemarkOpaqueParser/object):

(undocumented)

Returns:

int: (undocumented)

C signature

LLVMBool LLVMRemarkParserHasError(LLVMRemarkParserRef Parser)
rocm.bindings.llvm.c.remarks.LLVMRemarkParserGetErrorMessage(Parser)#

Returns a null-terminated string containing an error message.

In case of no error, the result is NULL.

The memory of the string is bound to the lifetime of Parser. If LLVMRemarkParserDispose() is called, the memory of the string will be released.

Since:

REMARKS_API_VERSION=0

Args:
Parser (LLVMRemarkOpaqueParser/object):

(undocumented)

Returns:

bytes: (undocumented)

C signature

const char * LLVMRemarkParserGetErrorMessage(LLVMRemarkParserRef Parser)
rocm.bindings.llvm.c.remarks.LLVMRemarkParserDispose(Parser)#

Releases all the resources used by Parser.

Since:

REMARKS_API_VERSION=0

Args:
Parser (LLVMRemarkOpaqueParser/object):

(undocumented)

C signature

void LLVMRemarkParserDispose(LLVMRemarkParserRef Parser)
rocm.bindings.llvm.c.remarks.LLVMRemarkVersion()#

Returns the version of the remarks library.

Since:

REMARKS_API_VERSION=0

Returns:

int: (undocumented)

C signature

uint32_t LLVMRemarkVersion()