From: Dmitry Dolgov <9erthalion6@gmail.com> Date: Thu, 1 Jun 2023 15:56:00 +0000 (-0700) Subject: Allow configuring InlinerThreshold in C bindings for the new pass manager X-Git-Tag: upstream/17.0.6~6436 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c20a9bb001855da5d14721ce2894e3be77a999fe;p=platform%2Fupstream%2Fllvm.git 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 --- diff --git a/llvm/include/llvm-c/Transforms/PassBuilder.h b/llvm/include/llvm-c/Transforms/PassBuilder.h index 6d9f1b4..d0466dd7 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 2a49ae6..0d3a3d7 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); }