Skip to content

Commit 0abf3fa

Browse files
committed
Disable function signature optimization at -Osize.
We might be more aggressive here in the future.
1 parent 64f2d64 commit 0abf3fa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/SILOptimizer/Transforms/FunctionSignatureOpts.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,6 +1140,11 @@ class FunctionSignatureOpts : public SILFunctionTransform {
11401140
void run() override {
11411141
auto *F = getFunction();
11421142

1143+
// Don't run function signature optimizations at -Os.
1144+
if (F->getModule().getOptions().Optimization ==
1145+
SILOptions::SILOptMode::OptimizeForSize)
1146+
return;
1147+
11431148
// Don't optimize callees that should not be optimized.
11441149
if (!F->shouldOptimize())
11451150
return;

0 commit comments

Comments
 (0)