-
Notifications
You must be signed in to change notification settings - Fork 789
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
[WIP] Parallel ILX Codegen #11531
Closed
Closed
[WIP] Parallel ILX Codegen #11531
Changes from 34 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
d238d25
Enabling parallel parsing for compiling
TIHan 9724f27
Using a delayed error logger per parsing file
TIHan 53f234a
Added -parallel option
TIHan bf07e86
Fixing error logger
TIHan 4b7c652
Moved parallel compiler option to be a test option
TIHan d2198df
Trying to get tests to pass
TIHan d4ad54c
Remove switch
TIHan 23d81e3
Minor refactor
TIHan 3f32f7d
More refactoring
TIHan 03c8b8a
Add comment
TIHan 51c897b
Initial work for parallel type checking
TIHan d3c674d
Minor refactor
TIHan 20f285e
Add max
TIHan f40de5b
Merge branch 'parallel-parsing-2' into parallel-type-checking
TIHan 6b06c3a
Some cleanup
TIHan c6c54b9
do not use SkipImpl
TIHan 0f39ad4
minor refactor
TIHan fa5d394
Merged main
TIHan 1236cbf
Merge branch 'parallel-parsing-2' into parallel-type-checking
TIHan 5c5a466
Handling aggregate exceptions from ArrayParallel. Using try/finally t…
TIHan 20e5263
Merge branch 'parallel-parsing-2' into parallel-type-checking
TIHan e5fa18b
Merged main
TIHan f408f04
Initial ilx-code-gen parallel work
TIHan b36f45a
compiles
TIHan 0db7045
Does not work but it tries to use parallelism
TIHan 17f3d9b
Compiles again
TIHan f4a298c
parallel ilx gen works
TIHan 8b419b3
Merging main
TIHan bdfcb4b
Merge branch 'parallel-type-checking' into parallel-ilx-codegen
TIHan c1e89ae
Refactoring a bit
TIHan 311d436
Fix build
TIHan 898f894
Merge branch 'parallel-type-checking' into parallel-ilx-codegen
TIHan e056a1a
Removing a few LOH allocs
TIHan d3a1c78
Merge remote-tracking branch 'remote/main' into parallel-ilx-codegen
TIHan 4adf375
merging
TIHan db1b986
Merging main
TIHan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ namespace Internal.Utilities | |
|
||
open System | ||
open System.IO | ||
open System.Buffers | ||
open System.IO.MemoryMappedFiles | ||
open System.Runtime.InteropServices | ||
open FSharp.NativeInterop | ||
|
@@ -439,10 +440,16 @@ type internal ByteBuffer = | |
let oldBufSize = buf.bbArray.Length | ||
if newSize > oldBufSize then | ||
let old = buf.bbArray | ||
buf.bbArray <- Bytes.zeroCreate (max newSize (oldBufSize * 2)) | ||
buf.bbArray <- ArrayPool.Shared.Rent(max newSize (oldBufSize * 2)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change should not be in this PR. |
||
Bytes.blit old 0 buf.bbArray 0 buf.bbCurrent | ||
ArrayPool.Shared.Return(old) | ||
|
||
member buf.Close () = Bytes.sub buf.bbArray 0 buf.bbCurrent | ||
member buf.Close () = | ||
let result = Bytes.sub buf.bbArray 0 buf.bbCurrent | ||
ArrayPool.Shared.Return(buf.bbArray) | ||
buf.bbArray <- [||] | ||
buf.bbCurrent <- 0 | ||
result | ||
|
||
member buf.EmitIntAsByte (i:int) = | ||
let newSize = buf.bbCurrent + 1 | ||
|
@@ -506,7 +513,7 @@ type internal ByteBuffer = | |
member buf.Position = buf.bbCurrent | ||
|
||
static member Create sz = | ||
{ bbArray=Bytes.zeroCreate sz | ||
{ bbArray = ArrayPool.Shared.Rent(sz) | ||
bbCurrent = 0 } | ||
|
||
[<Sealed>] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes made in ParseAndCheckInputs is from #11152 and needs to be removed in this PR.