[llvm] c20a9bb - Allow configuring InlinerThreshold in C bindings for the new pass manager
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 1 13:02:38 PDT 2023
Author: Dmitry Dolgov
Date: 2023-06-01T13:00:35-07:00
New Revision: c20a9bb001855da5d14721ce2894e3be77a999fe
URL: https://github.com/llvm/llvm-project/commit/c20a9bb001855da5d14721ce2894e3be77a999fe
DIFF: https://github.com/llvm/llvm-project/commit/c20a9bb001855da5d14721ce2894e3be77a999fe.diff
LOG: Allow configuring InlinerThreshold in C bindings for the new pass manager
C bindings for the new pass manager seem to allow to set any option from LLVMPassBuilderOptions, except InlinerThreshold. Allow to configure it as well.
Reviewed By: aeubanks
Differential Revision: https://reviews.llvm.org/D151832
Added:
Modified:
llvm/include/llvm-c/Transforms/PassBuilder.h
llvm/lib/Passes/PassBuilderBindings.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm-c/Transforms/PassBuilder.h b/llvm/include/llvm-c/Transforms/PassBuilder.h
index 6d9f1b45c7074..d0466dd7fc0a1 100644
--- a/llvm/include/llvm-c/Transforms/PassBuilder.h
+++ b/llvm/include/llvm-c/Transforms/PassBuilder.h
@@ -99,6 +99,9 @@ void LLVMPassBuilderOptionsSetCallGraphProfile(
void LLVMPassBuilderOptionsSetMergeFunctions(LLVMPassBuilderOptionsRef Options,
LLVMBool MergeFunctions);
+void LLVMPassBuilderOptionsSetInlinerThreshold(
+ LLVMPassBuilderOptionsRef Options, int Threshold);
+
/**
* Dispose of a heap-allocated PassBuilderOptions instance
*/
diff --git a/llvm/lib/Passes/PassBuilderBindings.cpp b/llvm/lib/Passes/PassBuilderBindings.cpp
index 2a49ae6e30e0a..0d3a3d7d02239 100644
--- a/llvm/lib/Passes/PassBuilderBindings.cpp
+++ b/llvm/lib/Passes/PassBuilderBindings.cpp
@@ -139,6 +139,11 @@ void LLVMPassBuilderOptionsSetMergeFunctions(LLVMPassBuilderOptionsRef Options,
unwrap(Options)->PTO.MergeFunctions = MergeFunctions;
}
+void LLVMPassBuilderOptionsSetInlinerThreshold(
+ LLVMPassBuilderOptionsRef Options, int Threshold) {
+ unwrap(Options)->PTO.InlinerThreshold = Threshold;
+}
+
void LLVMDisposePassBuilderOptions(LLVMPassBuilderOptionsRef Options) {
delete unwrap(Options);
}
More information about the llvm-commits
mailing list