rocm.bindings.llvm.c.transforms.passbuilder#

2026-09-24

10 min read time

Applies to Linux and Windows

Advanced Micro Devices, Inc.

Attributes#

Classes#

LLVMOpaquePassBuilderOptions

(No short description)

Functions#

has_symbol(→ bool)

LLVMRunPasses(M, Passes, TM, Options)

Construct and run a set of passes over a module

LLVMRunPassesOnFunction(F, Passes, TM, Options)

Construct and run a set of passes over a function.

LLVMCreatePassBuilderOptions()

Create a new set of options for a PassBuilder

LLVMPassBuilderOptionsSetVerifyEach(Options, VerifyEach)

Toggle adding the VerifierPass for the PassBuilder, ensuring all functions

LLVMPassBuilderOptionsSetDebugLogging(Options, ...)

Toggle debug logging when running the PassBuilder

LLVMPassBuilderOptionsSetAAPipeline(Options, AAPipeline)

Specify a custom alias analysis pipeline for the PassBuilder to be used

LLVMPassBuilderOptionsSetLoopInterleaving(Options, ...)

Specify a custom alias analysis pipeline for the PassBuilder to be used

LLVMPassBuilderOptionsSetLoopVectorization(Options, ...)

Specify a custom alias analysis pipeline for the PassBuilder to be used

LLVMPassBuilderOptionsSetSLPVectorization(Options, ...)

Specify a custom alias analysis pipeline for the PassBuilder to be used

LLVMPassBuilderOptionsSetLoopUnrolling(Options, ...)

Specify a custom alias analysis pipeline for the PassBuilder to be used

LLVMPassBuilderOptionsSetForgetAllSCEVInLoopUnroll(...)

Specify a custom alias analysis pipeline for the PassBuilder to be used

LLVMPassBuilderOptionsSetLicmMssaOptCap(Options, ...)

Specify a custom alias analysis pipeline for the PassBuilder to be used

LLVMPassBuilderOptionsSetLicmMssaNoAccForPromotionCap(...)

Specify a custom alias analysis pipeline for the PassBuilder to be used

LLVMPassBuilderOptionsSetCallGraphProfile(Options, ...)

Specify a custom alias analysis pipeline for the PassBuilder to be used

LLVMPassBuilderOptionsSetMergeFunctions(Options, ...)

Specify a custom alias analysis pipeline for the PassBuilder to be used

LLVMPassBuilderOptionsSetInlinerThreshold(Options, ...)

Specify a custom alias analysis pipeline for the PassBuilder to be used

LLVMDisposePassBuilderOptions(Options)

Dispose of a heap-allocated PassBuilderOptions instance

Module Contents#

rocm.bindings.llvm.c.transforms.passbuilder.has_symbol(name: str | bytes | bytearray) → bool#
class rocm.bindings.llvm.c.transforms.passbuilder.LLVMOpaquePassBuilderOptions(*args, **kwargs)#

Bases: rocm.bindings.util.types.Pointer

(No short description)

rocm.bindings.llvm.c.transforms.passbuilder.LLVMPassBuilderOptionsRef#
rocm.bindings.llvm.c.transforms.passbuilder.LLVMRunPasses(M, Passes, TM, Options)#

Construct and run a set of passes over a module

This function takes a string with the passes that should be used. The format of this string is the same as opt’s -passes argument for the new pass manager. Individual passes may be specified, separated by commas. Full pipelines may also be invoked using default and friends. See opt for full reference of the Passes format.

Args:
M (Pointer/object):

(undocumented)

Passes (CStr/object):

(undocumented)

TM (Pointer/object):

(undocumented)

Options (LLVMOpaquePassBuilderOptions/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMErrorRef LLVMRunPasses(LLVMModuleRef M, const char * Passes, LLVMTargetMachineRef TM, LLVMPassBuilderOptionsRef Options)
rocm.bindings.llvm.c.transforms.passbuilder.LLVMRunPassesOnFunction(F, Passes, TM, Options)#

Construct and run a set of passes over a function.

This function behaves the same as LLVMRunPasses, but operates on a single function instead of an entire module.

Args:
F (Pointer/object):

(undocumented)

Passes (CStr/object):

(undocumented)

TM (Pointer/object):

(undocumented)

Options (LLVMOpaquePassBuilderOptions/object):

(undocumented)

Returns:

None: (undocumented)

C signature

LLVMErrorRef LLVMRunPassesOnFunction(LLVMValueRef F, const char * Passes, LLVMTargetMachineRef TM, LLVMPassBuilderOptionsRef Options)
rocm.bindings.llvm.c.transforms.passbuilder.LLVMCreatePassBuilderOptions()#

Create a new set of options for a PassBuilder

Ownership of the returned instance is given to the client, and they are responsible for it. The client should call LLVMDisposePassBuilderOptions to free the pass builder options.

Returns:

None: (undocumented)

C signature

LLVMPassBuilderOptionsRef LLVMCreatePassBuilderOptions()
rocm.bindings.llvm.c.transforms.passbuilder.LLVMPassBuilderOptionsSetVerifyEach(Options, VerifyEach)#

Toggle adding the VerifierPass for the PassBuilder, ensuring all functions inside the module is valid.

Args:
Options (LLVMOpaquePassBuilderOptions/object):

(undocumented)

VerifyEach (int):

(undocumented)

C signature

void LLVMPassBuilderOptionsSetVerifyEach(LLVMPassBuilderOptionsRef Options, LLVMBool VerifyEach)
rocm.bindings.llvm.c.transforms.passbuilder.LLVMPassBuilderOptionsSetDebugLogging(Options, DebugLogging)#

Toggle debug logging when running the PassBuilder

Args:
Options (LLVMOpaquePassBuilderOptions/object):

(undocumented)

DebugLogging (int):

(undocumented)

C signature

void LLVMPassBuilderOptionsSetDebugLogging(LLVMPassBuilderOptionsRef Options, LLVMBool DebugLogging)
rocm.bindings.llvm.c.transforms.passbuilder.LLVMPassBuilderOptionsSetAAPipeline(Options, AAPipeline)#

Specify a custom alias analysis pipeline for the PassBuilder to be used instead of the default one.

The string argument is not copied; the caller is responsible for ensuring it outlives the PassBuilderOptions instance.

Args:
Options (LLVMOpaquePassBuilderOptions/object):

(undocumented)

AAPipeline (CStr/object):

(undocumented)

C signature

void LLVMPassBuilderOptionsSetAAPipeline(LLVMPassBuilderOptionsRef Options, const char * AAPipeline)
rocm.bindings.llvm.c.transforms.passbuilder.LLVMPassBuilderOptionsSetLoopInterleaving(Options, LoopInterleaving)#

Specify a custom alias analysis pipeline for the PassBuilder to be used instead of the default one.

The string argument is not copied; the caller is responsible for ensuring it outlives the PassBuilderOptions instance.

Args:
Options (LLVMOpaquePassBuilderOptions/object):

(undocumented)

LoopInterleaving (int):

(undocumented)

C signature

void LLVMPassBuilderOptionsSetLoopInterleaving(LLVMPassBuilderOptionsRef Options, LLVMBool LoopInterleaving)
rocm.bindings.llvm.c.transforms.passbuilder.LLVMPassBuilderOptionsSetLoopVectorization(Options, LoopVectorization)#

Specify a custom alias analysis pipeline for the PassBuilder to be used instead of the default one.

The string argument is not copied; the caller is responsible for ensuring it outlives the PassBuilderOptions instance.

Args:
Options (LLVMOpaquePassBuilderOptions/object):

(undocumented)

LoopVectorization (int):

(undocumented)

C signature

void LLVMPassBuilderOptionsSetLoopVectorization(LLVMPassBuilderOptionsRef Options, LLVMBool LoopVectorization)
rocm.bindings.llvm.c.transforms.passbuilder.LLVMPassBuilderOptionsSetSLPVectorization(Options, SLPVectorization)#

Specify a custom alias analysis pipeline for the PassBuilder to be used instead of the default one.

The string argument is not copied; the caller is responsible for ensuring it outlives the PassBuilderOptions instance.

Args:
Options (LLVMOpaquePassBuilderOptions/object):

(undocumented)

SLPVectorization (int):

(undocumented)

C signature

void LLVMPassBuilderOptionsSetSLPVectorization(LLVMPassBuilderOptionsRef Options, LLVMBool SLPVectorization)
rocm.bindings.llvm.c.transforms.passbuilder.LLVMPassBuilderOptionsSetLoopUnrolling(Options, LoopUnrolling)#

Specify a custom alias analysis pipeline for the PassBuilder to be used instead of the default one.

The string argument is not copied; the caller is responsible for ensuring it outlives the PassBuilderOptions instance.

Args:
Options (LLVMOpaquePassBuilderOptions/object):

(undocumented)

LoopUnrolling (int):

(undocumented)

C signature

void LLVMPassBuilderOptionsSetLoopUnrolling(LLVMPassBuilderOptionsRef Options, LLVMBool LoopUnrolling)
rocm.bindings.llvm.c.transforms.passbuilder.LLVMPassBuilderOptionsSetForgetAllSCEVInLoopUnroll(Options, ForgetAllSCEVInLoopUnroll)#

Specify a custom alias analysis pipeline for the PassBuilder to be used instead of the default one.

The string argument is not copied; the caller is responsible for ensuring it outlives the PassBuilderOptions instance.

Args:
Options (LLVMOpaquePassBuilderOptions/object):

(undocumented)

ForgetAllSCEVInLoopUnroll (int):

(undocumented)

C signature

void LLVMPassBuilderOptionsSetForgetAllSCEVInLoopUnroll(LLVMPassBuilderOptionsRef Options, LLVMBool ForgetAllSCEVInLoopUnroll)
rocm.bindings.llvm.c.transforms.passbuilder.LLVMPassBuilderOptionsSetLicmMssaOptCap(Options, LicmMssaOptCap)#

Specify a custom alias analysis pipeline for the PassBuilder to be used instead of the default one.

The string argument is not copied; the caller is responsible for ensuring it outlives the PassBuilderOptions instance.

Args:
Options (LLVMOpaquePassBuilderOptions/object):

(undocumented)

LicmMssaOptCap (int):

(undocumented)

C signature

void LLVMPassBuilderOptionsSetLicmMssaOptCap(LLVMPassBuilderOptionsRef Options, unsigned int LicmMssaOptCap)
rocm.bindings.llvm.c.transforms.passbuilder.LLVMPassBuilderOptionsSetLicmMssaNoAccForPromotionCap(Options, LicmMssaNoAccForPromotionCap)#

Specify a custom alias analysis pipeline for the PassBuilder to be used instead of the default one.

The string argument is not copied; the caller is responsible for ensuring it outlives the PassBuilderOptions instance.

Args:
Options (LLVMOpaquePassBuilderOptions/object):

(undocumented)

LicmMssaNoAccForPromotionCap (int):

(undocumented)

C signature

void LLVMPassBuilderOptionsSetLicmMssaNoAccForPromotionCap(LLVMPassBuilderOptionsRef Options, unsigned int LicmMssaNoAccForPromotionCap)
rocm.bindings.llvm.c.transforms.passbuilder.LLVMPassBuilderOptionsSetCallGraphProfile(Options, CallGraphProfile)#

Specify a custom alias analysis pipeline for the PassBuilder to be used instead of the default one.

The string argument is not copied; the caller is responsible for ensuring it outlives the PassBuilderOptions instance.

Args:
Options (LLVMOpaquePassBuilderOptions/object):

(undocumented)

CallGraphProfile (int):

(undocumented)

C signature

void LLVMPassBuilderOptionsSetCallGraphProfile(LLVMPassBuilderOptionsRef Options, LLVMBool CallGraphProfile)
rocm.bindings.llvm.c.transforms.passbuilder.LLVMPassBuilderOptionsSetMergeFunctions(Options, MergeFunctions)#

Specify a custom alias analysis pipeline for the PassBuilder to be used instead of the default one.

The string argument is not copied; the caller is responsible for ensuring it outlives the PassBuilderOptions instance.

Args:
Options (LLVMOpaquePassBuilderOptions/object):

(undocumented)

MergeFunctions (int):

(undocumented)

C signature

void LLVMPassBuilderOptionsSetMergeFunctions(LLVMPassBuilderOptionsRef Options, LLVMBool MergeFunctions)
rocm.bindings.llvm.c.transforms.passbuilder.LLVMPassBuilderOptionsSetInlinerThreshold(Options, Threshold)#

Specify a custom alias analysis pipeline for the PassBuilder to be used instead of the default one.

The string argument is not copied; the caller is responsible for ensuring it outlives the PassBuilderOptions instance.

Args:
Options (LLVMOpaquePassBuilderOptions/object):

(undocumented)

Threshold (int):

(undocumented)

C signature

void LLVMPassBuilderOptionsSetInlinerThreshold(LLVMPassBuilderOptionsRef Options, int Threshold)
rocm.bindings.llvm.c.transforms.passbuilder.LLVMDisposePassBuilderOptions(Options)#

Dispose of a heap-allocated PassBuilderOptions instance

Args:
Options (LLVMOpaquePassBuilderOptions/object):

(undocumented)

C signature

void LLVMDisposePassBuilderOptions(LLVMPassBuilderOptionsRef Options)