Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
d238d25
Enabling parallel parsing for compiling
TIHan Feb 23, 2021
9724f27
Using a delayed error logger per parsing file
TIHan Feb 23, 2021
53f234a
Added -parallel option
TIHan Feb 24, 2021
bf07e86
Fixing error logger
TIHan Feb 24, 2021
4b7c652
Moved parallel compiler option to be a test option
TIHan Feb 25, 2021
d2198df
Trying to get tests to pass
TIHan Feb 25, 2021
d4ad54c
Remove switch
TIHan Feb 25, 2021
23d81e3
Minor refactor
TIHan Feb 25, 2021
3f32f7d
More refactoring
TIHan Feb 25, 2021
03c8b8a
Add comment
TIHan Feb 25, 2021
51c897b
Initial work for parallel type checking
TIHan Feb 25, 2021
d3c674d
Minor refactor
TIHan Feb 26, 2021
20f285e
Add max
TIHan Feb 26, 2021
f40de5b
Merge branch 'parallel-parsing-2' into parallel-type-checking
TIHan Feb 26, 2021
6b06c3a
Some cleanup
TIHan Feb 26, 2021
c6c54b9
do not use SkipImpl
TIHan Feb 26, 2021
0f39ad4
minor refactor
TIHan Feb 26, 2021
fa5d394
Merged main
TIHan Feb 26, 2021
1236cbf
Merge branch 'parallel-parsing-2' into parallel-type-checking
TIHan Feb 26, 2021
5c5a466
Handling aggregate exceptions from ArrayParallel. Using try/finally t…
TIHan Mar 2, 2021
20e5263
Merge branch 'parallel-parsing-2' into parallel-type-checking
TIHan Mar 2, 2021
e5fa18b
Merged main
TIHan Mar 3, 2021
f408f04
Initial ilx-code-gen parallel work
TIHan Mar 3, 2021
b36f45a
compiles
TIHan Mar 3, 2021
0db7045
Does not work but it tries to use parallelism
TIHan Mar 3, 2021
17f3d9b
Compiles again
TIHan Mar 3, 2021
f4a298c
parallel ilx gen works
TIHan Mar 3, 2021
8b419b3
Merging main
TIHan Mar 4, 2021
bdfcb4b
Merge branch 'parallel-type-checking' into parallel-ilx-codegen
TIHan Mar 4, 2021
c1e89ae
Refactoring a bit
TIHan Mar 5, 2021
311d436
Fix build
TIHan Mar 5, 2021
898f894
Merge branch 'parallel-type-checking' into parallel-ilx-codegen
TIHan Mar 5, 2021
e056a1a
Removing a few LOH allocs
TIHan Mar 5, 2021
d3a1c78
Merge remote-tracking branch 'remote/main' into parallel-ilx-codegen
TIHan May 6, 2021
4adf375
merging
TIHan May 10, 2021
db1b986
Merging main
TIHan Nov 4, 2021
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
Prev Previous commit
Next Next commit
Compiles again
  • Loading branch information
TIHan committed Mar 3, 2021
commit 17f3d9b1026f92e6a3515d0fdf21cd30bd618f52
18 changes: 13 additions & 5 deletions src/fsharp/IlxGen.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module internal FSharp.Compiler.IlxGen
open System.IO
open System.Reflection
open System.Collections.Generic
open System.Collections.Immutable

open Internal.Utilities
open Internal.Utilities.Collections
Expand Down Expand Up @@ -896,6 +897,8 @@ and IlxGenEnv =
isInLoop: bool

delayCodeGen: bool

delayedFileGen: ImmutableArray<(cenv -> unit) []>
}

override _.ToString() = "<IlxGenEnv>"
Expand Down Expand Up @@ -7101,7 +7104,9 @@ and GenImplFile cenv (mgbuf: AssemblyBuilder) mainInfoOpt eenv (implFile: TypedI
let allocVal = ComputeAndAddStorageForLocalTopVal (cenv.amap, g, cenv.intraAssemblyInfo, cenv.opts.isInteractive, NoShadowLocal)
AddBindingsForLocalModuleType allocVal clocCcu eenv mexpr.Type

eenvafter
let eenvfinal = { eenvafter with delayedFileGen = eenvafter.delayedFileGen.Add(cenv.delayedGenMethods |> Array.ofSeq) }
cenv.delayedGenMethods.Clear()
eenvfinal

and GenForceWholeFileInitializationAsPartOfCCtor cenv (mgbuf: AssemblyBuilder) (lazyInitInfo: ResizeArray<_>) tref m =
// Authoring a .cctor with effects forces the cctor for the 'initialization' module by doing a dummy store & load of a field
Expand Down Expand Up @@ -7981,11 +7986,13 @@ let CodegenAssembly cenv eenv mgbuf implFiles =
let eenv = List.fold (GenImplFile cenv mgbuf None) eenv a
let eenv = GenImplFile cenv mgbuf cenv.opts.mainMethodInfo eenv b

let genMeths = cenv.delayedGenMethods |> Array.ofSeq
cenv.delayedGenMethods.Clear()
let genMeths = eenv.delayedFileGen |> Array.ofSeq

genMeths
|> ArrayParallel.iter (fun gen -> gen cenv)
|> Array.iter (fun genMeths ->
genMeths
|> Array.iter (fun gen -> gen cenv)
)

// Some constructs generate residue types and bindings. Generate these now. They don't result in any
// top-level initialization code.
Expand Down Expand Up @@ -8025,7 +8032,8 @@ let GetEmptyIlxGenEnv (g: TcGlobals) ccu =
sigToImplRemapInfo = [] (* "module remap info" *)
withinSEH = false
isInLoop = false
delayCodeGen = true }
delayCodeGen = true
delayedFileGen = ImmutableArray.Empty }

type IlxGenResults =
{ ilTypeDefs: ILTypeDef list
Expand Down