mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add a SILOption to control whether we should use an aggressive form of
keeping large values indirect
This commit is contained in:
@@ -3738,6 +3738,7 @@ bool CompilerInvocation::parseArgs(
|
||||
SILOpts.SkipFunctionBodies = FunctionBodySkipping::None;
|
||||
SILOpts.CMOMode = CrossModuleOptimizationMode::Everything;
|
||||
SILOpts.EmbeddedSwift = true;
|
||||
SILOpts.UseAggressiveReg2MemForCodeSize = true;
|
||||
// OSSA modules are required for deinit de-virtualization.
|
||||
SILOpts.EnableOSSAModules = true;
|
||||
// -g is promoted to -gdwarf-types in embedded Swift
|
||||
@@ -3751,6 +3752,11 @@ bool CompilerInvocation::parseArgs(
|
||||
}
|
||||
}
|
||||
|
||||
SILOpts.UseAggressiveReg2MemForCodeSize =
|
||||
ParsedArgs.hasFlag(OPT_enable_aggressive_reg2mem,
|
||||
OPT_disable_aggressive_reg2mem,
|
||||
SILOpts.UseAggressiveReg2MemForCodeSize);
|
||||
|
||||
// With Swift 6, enable @_spiOnly by default. This also enables proper error
|
||||
// reporting of ioi references from spi decls.
|
||||
if (LangOpts.EffectiveLanguageVersion.isVersionAtLeast(6)) {
|
||||
|
||||
Reference in New Issue
Block a user