rocm.bindings.llvm.c.transforms.cypassbuilder#
2026-09-24
6 min read time
Applies to Linux and Windows
Advanced Micro Devices, Inc.
Cython declarations for the C-level interface. Use
cimport rocm.bindings.llvm.c.transforms.cypassbuilder from your Cython code to access
these declarations directly.
See also
The high-level Python API is documented at rocm.bindings.llvm.c.transforms.passbuilder.
# MIT License
#
# Copyright (c) 2021-2026 Advanced Micro Devices, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# This file has been autogenerated, do not modify.
from libc.stdint cimport *
ctypedef bint _Bool # bool is not a reserved keyword in C, _Bool is
from rocm.bindings.llvm.c.cyerror cimport *
from rocm.bindings.llvm.c.cytargetmachine cimport *
from rocm.bindings.llvm.c.cytypes cimport *
from rocm.bindings.llvm.c.cyvisibility cimport *
cdef extern from "llvm-c/Transforms/PassBuilder.h":
cdef struct LLVMOpaquePassBuilderOptions:
pass
ctypedef LLVMOpaquePassBuilderOptions * LLVMPassBuilderOptionsRef
#
# 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<O3>` and friends. See opt for
# full reference of the Passes format.
cdef LLVMErrorRef LLVMRunPasses(LLVMModuleRef M,const char * Passes,LLVMTargetMachineRef TM,LLVMPassBuilderOptionsRef Options) except? NULL nogil
#
# 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.
cdef LLVMErrorRef LLVMRunPassesOnFunction(LLVMValueRef F,const char * Passes,LLVMTargetMachineRef TM,LLVMPassBuilderOptionsRef Options) except? NULL nogil
#
# 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.
cdef LLVMPassBuilderOptionsRef LLVMCreatePassBuilderOptions() except? NULL nogil
#
# Toggle adding the VerifierPass for the PassBuilder, ensuring all functions
# inside the module is valid.
cdef void LLVMPassBuilderOptionsSetVerifyEach(LLVMPassBuilderOptionsRef Options,int VerifyEach) noexcept nogil
#
# Toggle debug logging when running the PassBuilder
cdef void LLVMPassBuilderOptionsSetDebugLogging(LLVMPassBuilderOptionsRef Options,int DebugLogging) noexcept nogil
#
# 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.
cdef void LLVMPassBuilderOptionsSetAAPipeline(LLVMPassBuilderOptionsRef Options,const char * AAPipeline) noexcept nogil
cdef void LLVMPassBuilderOptionsSetLoopInterleaving(LLVMPassBuilderOptionsRef Options,int LoopInterleaving) noexcept nogil
cdef void LLVMPassBuilderOptionsSetLoopVectorization(LLVMPassBuilderOptionsRef Options,int LoopVectorization) noexcept nogil
cdef void LLVMPassBuilderOptionsSetSLPVectorization(LLVMPassBuilderOptionsRef Options,int SLPVectorization) noexcept nogil
cdef void LLVMPassBuilderOptionsSetLoopUnrolling(LLVMPassBuilderOptionsRef Options,int LoopUnrolling) noexcept nogil
cdef void LLVMPassBuilderOptionsSetForgetAllSCEVInLoopUnroll(LLVMPassBuilderOptionsRef Options,int ForgetAllSCEVInLoopUnroll) noexcept nogil
cdef void LLVMPassBuilderOptionsSetLicmMssaOptCap(LLVMPassBuilderOptionsRef Options,unsigned int LicmMssaOptCap) noexcept nogil
cdef void LLVMPassBuilderOptionsSetLicmMssaNoAccForPromotionCap(LLVMPassBuilderOptionsRef Options,unsigned int LicmMssaNoAccForPromotionCap) noexcept nogil
cdef void LLVMPassBuilderOptionsSetCallGraphProfile(LLVMPassBuilderOptionsRef Options,int CallGraphProfile) noexcept nogil
cdef void LLVMPassBuilderOptionsSetMergeFunctions(LLVMPassBuilderOptionsRef Options,int MergeFunctions) noexcept nogil
cdef void LLVMPassBuilderOptionsSetInlinerThreshold(LLVMPassBuilderOptionsRef Options,int Threshold) noexcept nogil
#
# Dispose of a heap-allocated PassBuilderOptions instance
cdef void LLVMDisposePassBuilderOptions(LLVMPassBuilderOptionsRef Options) noexcept nogil
cdef bint __passbuilder_has_symbol(const char* name) noexcept nogil