Skip to content

Commit 7cc11a5

Browse files
committed
[sil-inliner] Introduce a staging flag to enable the inlining of generics.
Use the following options to enable this flag: -Xllvm -sil-inline-generics
1 parent 5d3a7f7 commit 7cc11a5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/SILOptimizer/Transforms/PerformanceInliner.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ llvm::cl::opt<bool> PrintShortestPathInfo(
4343
"print-shortest-path-info", llvm::cl::init(false),
4444
llvm::cl::desc("Print shortest-path information for inlining"));
4545

46+
llvm::cl::opt<bool> EnableSILInliningOfGenerics(
47+
"sil-inline-generics", llvm::cl::init(false),
48+
llvm::cl::desc("Enable inlining of generics"));
49+
4650
//===----------------------------------------------------------------------===//
4751
// ConstantTracker
4852
//===----------------------------------------------------------------------===//
@@ -1121,7 +1125,8 @@ SILFunction *SILPerformanceInliner::getEligibleFunction(FullApplySite AI) {
11211125

11221126
// We don't support this yet.
11231127
if (AI.hasSubstitutions()) {
1124-
return nullptr;
1128+
if (!EnableSILInliningOfGenerics)
1129+
return nullptr;
11251130
}
11261131

11271132
SILFunction *Caller = AI.getFunction();

0 commit comments

Comments
 (0)