Allow configuring InlinerThreshold in C bindings for the new pass manager
authorDmitry Dolgov <9erthalion6@gmail.com>
Thu, 1 Jun 2023 15:56:00 +0000 (08:56 -0700)
committerArthur Eubanks <aeubanks@google.com>
Thu, 1 Jun 2023 20:00:35 +0000 (13:00 -0700)
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

llvm/include/llvm-c/Transforms/PassBuilder.h
llvm/lib/Passes/PassBuilderBindings.cpp

index 6d9f1b4..d0466dd 100644 (file)
@@ -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
  */
index 2a49ae6..0d3a3d7 100644 (file)
@@ -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);
 }