Path: blob/main/contrib/llvm-project/llvm/include/llvm-c/Transforms/PassBuilder.h
35269 views
/*===-- llvm-c/Transform/PassBuilder.h - PassBuilder for LLVM C ---*- C -*-===*\1|* *|2|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|3|* 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|* This header contains the LLVM-C interface into the new pass manager *|10|* *|11\*===----------------------------------------------------------------------===*/1213#ifndef LLVM_C_TRANSFORMS_PASSBUILDER_H14#define LLVM_C_TRANSFORMS_PASSBUILDER_H1516#include "llvm-c/Error.h"17#include "llvm-c/TargetMachine.h"18#include "llvm-c/Types.h"1920/**21* @defgroup LLVMCCoreNewPM New Pass Manager22* @ingroup LLVMCCore23*24* @{25*/2627LLVM_C_EXTERN_C_BEGIN2829/**30* A set of options passed which are attached to the Pass Manager upon run.31*32* This corresponds to an llvm::LLVMPassBuilderOptions instance33*34* The details for how the different properties of this structure are used can35* be found in the source for LLVMRunPasses36*/37typedef struct LLVMOpaquePassBuilderOptions *LLVMPassBuilderOptionsRef;3839/**40* Construct and run a set of passes over a module41*42* This function takes a string with the passes that should be used. The format43* of this string is the same as opt's -passes argument for the new pass44* manager. Individual passes may be specified, separated by commas. Full45* pipelines may also be invoked using `default<O3>` and friends. See opt for46* full reference of the Passes format.47*/48LLVMErrorRef LLVMRunPasses(LLVMModuleRef M, const char *Passes,49LLVMTargetMachineRef TM,50LLVMPassBuilderOptionsRef Options);5152/**53* Create a new set of options for a PassBuilder54*55* Ownership of the returned instance is given to the client, and they are56* responsible for it. The client should call LLVMDisposePassBuilderOptions57* to free the pass builder options.58*/59LLVMPassBuilderOptionsRef LLVMCreatePassBuilderOptions(void);6061/**62* Toggle adding the VerifierPass for the PassBuilder, ensuring all functions63* inside the module is valid.64*/65void LLVMPassBuilderOptionsSetVerifyEach(LLVMPassBuilderOptionsRef Options,66LLVMBool VerifyEach);6768/**69* Toggle debug logging when running the PassBuilder70*/71void LLVMPassBuilderOptionsSetDebugLogging(LLVMPassBuilderOptionsRef Options,72LLVMBool DebugLogging);7374void LLVMPassBuilderOptionsSetLoopInterleaving(75LLVMPassBuilderOptionsRef Options, LLVMBool LoopInterleaving);7677void LLVMPassBuilderOptionsSetLoopVectorization(78LLVMPassBuilderOptionsRef Options, LLVMBool LoopVectorization);7980void LLVMPassBuilderOptionsSetSLPVectorization(81LLVMPassBuilderOptionsRef Options, LLVMBool SLPVectorization);8283void LLVMPassBuilderOptionsSetLoopUnrolling(LLVMPassBuilderOptionsRef Options,84LLVMBool LoopUnrolling);8586void LLVMPassBuilderOptionsSetForgetAllSCEVInLoopUnroll(87LLVMPassBuilderOptionsRef Options, LLVMBool ForgetAllSCEVInLoopUnroll);8889void LLVMPassBuilderOptionsSetLicmMssaOptCap(LLVMPassBuilderOptionsRef Options,90unsigned LicmMssaOptCap);9192void LLVMPassBuilderOptionsSetLicmMssaNoAccForPromotionCap(93LLVMPassBuilderOptionsRef Options, unsigned LicmMssaNoAccForPromotionCap);9495void LLVMPassBuilderOptionsSetCallGraphProfile(96LLVMPassBuilderOptionsRef Options, LLVMBool CallGraphProfile);9798void LLVMPassBuilderOptionsSetMergeFunctions(LLVMPassBuilderOptionsRef Options,99LLVMBool MergeFunctions);100101void LLVMPassBuilderOptionsSetInlinerThreshold(102LLVMPassBuilderOptionsRef Options, int Threshold);103104/**105* Dispose of a heap-allocated PassBuilderOptions instance106*/107void LLVMDisposePassBuilderOptions(LLVMPassBuilderOptionsRef Options);108109/**110* @}111*/112113LLVM_C_EXTERN_C_END114115#endif // LLVM_C_TRANSFORMS_PASSBUILDER_H116117118