Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn a bunch of options by default #17442

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from 18 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
<EnablePublishReadyToRun Condition="'$(SourceBuildUseMonoRuntime)' == 'true'">false</EnablePublishReadyToRun>
</PropertyGroup>

<!-- Set parallel options on by default for compiler. Once compiler with new options is shipped, they need to be used -->
vzarytovskii marked this conversation as resolved.
Show resolved Hide resolved
<PropertyGroup>
<OtherFlags>$(OtherFlags) --test:ParallelOptimization --test:GraphBasedChecking</OtherFlags>
</PropertyGroup>

<Import Project="$(RepoRoot)/Directory.Build.props.user" Condition="Exists('$(RepoRoot)/Directory.Build.props.user')" />

<PropertyGroup Condition="'$(BUILDING_USING_DOTNET)' == 'true'">
Expand Down
2 changes: 2 additions & 0 deletions docs/release-notes/.FSharp.Compiler.Service/9.0.100.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@
* Applied nullable reference types to FSharp.Compiler.Service itself ([PR #15310](https://github.com/dotnet/fsharp/pull/15310))
* Ensure that isinteractive multi-emit backing fields are not public. ([Issue #17439](https://github.com/dotnet/fsharp/issues/17438)), ([PR #17439](https://github.com/dotnet/fsharp/pull/17439))
* Enable FSharp 9.0 Language Version ([Issue #17497](https://github.com/dotnet/fsharp/issues/17438)), [PR](https://github.com/dotnet/fsharp/pull/17500)))
* Enable graph type checking and parallel optimizations by default, can be turned off via the following compiler flags `--graphtypechecking-` and `--paralleloptimization-` respectivelly. ([PR #17442](https://github.com/dotnet/fsharp/pull/17442))
* Added flags for enabling parallel ILx generation and parallel reference resolution, to enable, turn on the following compiler flags: `--parallelilxgen+` and `--parallelreferenceresolution+` ([PR #17442](https://github.com/dotnet/fsharp/pull/17442))
* Better error reporting for unions with duplicated fields. ([PR #17521](https://github.com/dotnet/fsharp/pull/17521))
### Breaking Changes
17 changes: 3 additions & 14 deletions src/Compiler/Driver/CompilerConfig.fs
Original file line number Diff line number Diff line change
Expand Up @@ -766,18 +766,11 @@ type TcConfigBuilder =
doTLR = false
doFinalSimplify = false
optsOn = false
optSettings =
{ OptimizationSettings.Defaults with
processingMode =
if FSharpExperimentalFeaturesEnabledAutomatically then
OptimizationProcessingMode.Parallel
else
OptimizationProcessingMode.Sequential
}
optSettings = OptimizationSettings.Defaults
emitTailcalls = true
deterministic = false
concurrentBuild = true
parallelIlxGen = FSharpExperimentalFeaturesEnabledAutomatically
parallelIlxGen = false
emitMetadataAssembly = MetadataAssemblyGeneration.None
preferredUiLang = None
lcid = None
Expand Down Expand Up @@ -823,11 +816,7 @@ type TcConfigBuilder =
captureIdentifiersWhenParsing = false
typeCheckingConfig =
{
TypeCheckingConfig.Mode =
if FSharpExperimentalFeaturesEnabledAutomatically then
TypeCheckingMode.Graph
else
TypeCheckingMode.Sequential
TypeCheckingConfig.Mode = TypeCheckingMode.Graph
DumpGraph = false
}
dumpSignatureData = false
Expand Down
67 changes: 67 additions & 0 deletions src/Compiler/Driver/CompilerOptions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,41 @@ let SetDeterministicSwitch (tcConfigB: TcConfigBuilder) switch =
let SetRealsig (tcConfigB: TcConfigBuilder) switch =
tcConfigB.realsig <- (switch = OptionSwitch.On)

let SetGraphTypeCheckingSwitch (tcConfigB: TcConfigBuilder) switch =
match switch with
| OptionSwitch.On ->
tcConfigB.typeCheckingConfig <-
{ tcConfigB.typeCheckingConfig with
TypeCheckingConfig.Mode = TypeCheckingMode.Graph
}

| OptionSwitch.Off ->
tcConfigB.typeCheckingConfig <-
{ tcConfigB.typeCheckingConfig with
TypeCheckingConfig.Mode = TypeCheckingMode.Sequential
}

let SetParallelOptimizationSwitch (tcConfigB: TcConfigBuilder) switch =
match switch with
| OptionSwitch.On ->
tcConfigB.optSettings <-
{ tcConfigB.optSettings with
processingMode = OptimizationProcessingMode.Parallel
}
| OptionSwitch.Off ->
tcConfigB.optSettings <-
{ tcConfigB.optSettings with
processingMode = OptimizationProcessingMode.Sequential
}

let SetParallelIlxGenSwitch (tcConfigB: TcConfigBuilder) switch =
tcConfigB.parallelIlxGen <- (switch = OptionSwitch.On)

let SetPparallelReferenceResolutionSwitch (tcConfigB: TcConfigBuilder) switch =
match switch with
| OptionSwitch.On -> tcConfigB.parallelReferenceResolution <- ParallelReferenceResolution.On
| OptionSwitch.Off -> tcConfigB.parallelReferenceResolution <- ParallelReferenceResolution.Off

let SetReferenceAssemblyOnlySwitch (tcConfigB: TcConfigBuilder) switch =
match tcConfigB.emitMetadataAssembly with
| MetadataAssemblyGeneration.None when (not tcConfigB.standalone) && tcConfigB.extraStaticLinkRoots.IsEmpty ->
Expand Down Expand Up @@ -1056,6 +1091,38 @@ let codeGenerationFlags isFsi (tcConfigB: TcConfigBuilder) =
None,
Some(FSComp.SR.optsReflectionFree ())
)

CompilerOption(
"graphtypechecking",
tagNone,
OptionSwitch(SetGraphTypeCheckingSwitch tcConfigB),
None,
Some(FSComp.SR.optsGraphTypeChecking ())
)

CompilerOption(
"paralleloptimization",
tagNone,
OptionSwitch(SetParallelOptimizationSwitch tcConfigB),
None,
Some(FSComp.SR.optsParallelOptimization ())
)

CompilerOption(
"parallelilxgen",
tagNone,
OptionSwitch(SetParallelIlxGenSwitch tcConfigB),
None,
Some(FSComp.SR.optsParallelIlxGen ())
)

CompilerOption(
"parallelreferenceresolution",
tagNone,
OptionSwitch(SetPparallelReferenceResolutionSwitch tcConfigB),
None,
Some(FSComp.SR.optsParallelReferenceResolution ())
)
]

if isFsi then debug @ codegen else debug @ embed @ codegen
Expand Down
4 changes: 4 additions & 0 deletions src/Compiler/FSComp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,10 @@ optsEmitDebugInfoInQuotations,"Emit debug information in quotations"
optsPreferredUiLang,"Specify the preferred output language culture name (e.g. es-ES, ja-JP)"
optsNoCopyFsharpCore,"Don't copy FSharp.Core.dll along the produced binaries"
optsSignatureData,"Include F# interface information, the default is file. Essential for distributing libraries."
optsGraphTypeChecking,"Use graph typechecking."
optsParallelOptimization,"Enable parallel optimization."
optsParallelIlxGen,"Enable parallel IL generation."
optsParallelReferenceResolution,"Enable parallel reference resolution."
1046,optsUnknownSignatureData,"Invalid value '%s' for --interfacedata, valid value are: none, file, compress."
optsOptimizationData,"Specify included optimization information, the default is file. Important for distributed libraries."
1047,optsUnknownOptimizationData,"Invalid value '%s' for --optimizationdata, valid value are: none, file, compress."
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/Optimize/Optimizer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ type OptimizationSettings =
reportFunctionSizes = false
reportHasEffect = false
reportTotalSizes = false
processingMode = OptimizationProcessingMode.Sequential
processingMode = OptimizationProcessingMode.Parallel
}

/// Determines if JIT optimizations are enabled
Expand Down
20 changes: 20 additions & 0 deletions src/Compiler/xlf/FSComp.txt.cs.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions src/Compiler/xlf/FSComp.txt.de.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions src/Compiler/xlf/FSComp.txt.es.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions src/Compiler/xlf/FSComp.txt.fr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions src/Compiler/xlf/FSComp.txt.it.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions src/Compiler/xlf/FSComp.txt.ja.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading