[Clang][ASTMatcher] Add a matcher for the name of a DependentScopeDeclRefExpr (#121656)
[llvm-project.git] / llvm / include / llvm-c / Transforms / PassBuilder.h
blobd297b57cadd07d306472542454fa9cd1b08593e4
1 /*===-- llvm-c/Transform/PassBuilder.h - PassBuilder for LLVM C ---*- C -*-===*\
2 |* *|
3 |* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
4 |* Exceptions. *|
5 |* See https://llvm.org/LICENSE.txt for license information. *|
6 |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
7 |* *|
8 |*===----------------------------------------------------------------------===*|
9 |* *|
10 |* This header contains the LLVM-C interface into the new pass manager *|
11 |* *|
12 \*===----------------------------------------------------------------------===*/
14 #ifndef LLVM_C_TRANSFORMS_PASSBUILDER_H
15 #define LLVM_C_TRANSFORMS_PASSBUILDER_H
17 #include "llvm-c/Error.h"
18 #include "llvm-c/TargetMachine.h"
19 #include "llvm-c/Types.h"
21 /**
22 * @defgroup LLVMCCoreNewPM New Pass Manager
23 * @ingroup LLVMCCore
25 * @{
28 LLVM_C_EXTERN_C_BEGIN
30 /**
31 * A set of options passed which are attached to the Pass Manager upon run.
33 * This corresponds to an llvm::LLVMPassBuilderOptions instance
35 * The details for how the different properties of this structure are used can
36 * be found in the source for LLVMRunPasses
38 typedef struct LLVMOpaquePassBuilderOptions *LLVMPassBuilderOptionsRef;
40 /**
41 * Construct and run a set of passes over a module
43 * This function takes a string with the passes that should be used. The format
44 * of this string is the same as opt's -passes argument for the new pass
45 * manager. Individual passes may be specified, separated by commas. Full
46 * pipelines may also be invoked using `default<O3>` and friends. See opt for
47 * full reference of the Passes format.
49 LLVMErrorRef LLVMRunPasses(LLVMModuleRef M, const char *Passes,
50 LLVMTargetMachineRef TM,
51 LLVMPassBuilderOptionsRef Options);
53 /**
54 * Construct and run a set of passes over a function.
56 * This function behaves the same as LLVMRunPasses, but operates on a single
57 * function instead of an entire module.
59 LLVMErrorRef LLVMRunPassesOnFunction(LLVMValueRef F, const char *Passes,
60 LLVMTargetMachineRef TM,
61 LLVMPassBuilderOptionsRef Options);
63 /**
64 * Create a new set of options for a PassBuilder
66 * Ownership of the returned instance is given to the client, and they are
67 * responsible for it. The client should call LLVMDisposePassBuilderOptions
68 * to free the pass builder options.
70 LLVMPassBuilderOptionsRef LLVMCreatePassBuilderOptions(void);
72 /**
73 * Toggle adding the VerifierPass for the PassBuilder, ensuring all functions
74 * inside the module is valid.
76 void LLVMPassBuilderOptionsSetVerifyEach(LLVMPassBuilderOptionsRef Options,
77 LLVMBool VerifyEach);
79 /**
80 * Toggle debug logging when running the PassBuilder
82 void LLVMPassBuilderOptionsSetDebugLogging(LLVMPassBuilderOptionsRef Options,
83 LLVMBool DebugLogging);
85 /**
86 * Specify a custom alias analysis pipeline for the PassBuilder to be used
87 * instead of the default one. The string argument is not copied; the caller
88 * is responsible for ensuring it outlives the PassBuilderOptions instance.
90 void LLVMPassBuilderOptionsSetAAPipeline(LLVMPassBuilderOptionsRef Options,
91 const char *AAPipeline);
93 void LLVMPassBuilderOptionsSetLoopInterleaving(
94 LLVMPassBuilderOptionsRef Options, LLVMBool LoopInterleaving);
96 void LLVMPassBuilderOptionsSetLoopVectorization(
97 LLVMPassBuilderOptionsRef Options, LLVMBool LoopVectorization);
99 void LLVMPassBuilderOptionsSetSLPVectorization(
100 LLVMPassBuilderOptionsRef Options, LLVMBool SLPVectorization);
102 void LLVMPassBuilderOptionsSetLoopUnrolling(LLVMPassBuilderOptionsRef Options,
103 LLVMBool LoopUnrolling);
105 void LLVMPassBuilderOptionsSetForgetAllSCEVInLoopUnroll(
106 LLVMPassBuilderOptionsRef Options, LLVMBool ForgetAllSCEVInLoopUnroll);
108 void LLVMPassBuilderOptionsSetLicmMssaOptCap(LLVMPassBuilderOptionsRef Options,
109 unsigned LicmMssaOptCap);
111 void LLVMPassBuilderOptionsSetLicmMssaNoAccForPromotionCap(
112 LLVMPassBuilderOptionsRef Options, unsigned LicmMssaNoAccForPromotionCap);
114 void LLVMPassBuilderOptionsSetCallGraphProfile(
115 LLVMPassBuilderOptionsRef Options, LLVMBool CallGraphProfile);
117 void LLVMPassBuilderOptionsSetMergeFunctions(LLVMPassBuilderOptionsRef Options,
118 LLVMBool MergeFunctions);
120 void LLVMPassBuilderOptionsSetInlinerThreshold(
121 LLVMPassBuilderOptionsRef Options, int Threshold);
124 * Dispose of a heap-allocated PassBuilderOptions instance
126 void LLVMDisposePassBuilderOptions(LLVMPassBuilderOptionsRef Options);
129 * @}
132 LLVM_C_EXTERN_C_END
134 #endif // LLVM_C_TRANSFORMS_PASSBUILDER_H