Skip to content

Commit 056f265

Browse files
erthaliontroelsbjerre
authored andcommitted
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
1 parent b6409c3 commit 056f265

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

llvm/include/llvm-c/Transforms/PassBuilder.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ void LLVMPassBuilderOptionsSetCallGraphProfile(
9999
void LLVMPassBuilderOptionsSetMergeFunctions(LLVMPassBuilderOptionsRef Options,
100100
LLVMBool MergeFunctions);
101101

102+
void LLVMPassBuilderOptionsSetInlinerThreshold(
103+
LLVMPassBuilderOptionsRef Options, int Threshold);
104+
102105
/**
103106
* Dispose of a heap-allocated PassBuilderOptions instance
104107
*/

llvm/lib/Passes/PassBuilderBindings.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ void LLVMPassBuilderOptionsSetMergeFunctions(LLVMPassBuilderOptionsRef Options,
139139
unwrap(Options)->PTO.MergeFunctions = MergeFunctions;
140140
}
141141

142+
void LLVMPassBuilderOptionsSetInlinerThreshold(
143+
LLVMPassBuilderOptionsRef Options, int Threshold) {
144+
unwrap(Options)->PTO.InlinerThreshold = Threshold;
145+
}
146+
142147
void LLVMDisposePassBuilderOptions(LLVMPassBuilderOptionsRef Options) {
143148
delete unwrap(Options);
144149
}

0 commit comments

Comments
 (0)