-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compiler: enable parallel codegen with MT (#14748)
Implements parallel codegen of object files when MT is enabled in the compiler (`-Dpreview_mt`). It only impacts codegen for compilations with more than one compilation unit (module), that is when neither of `--single-module`, `--release` or `--cross-compile` is specified. This behavior is identical to the fork based codegen. **Advantages:** - allows parallel codegen on Windows (untested); - no need to fork many processes; - no repeated GC collections in each forked processes; - a simple Channel to distribute work efficiently (no need for IPC). The main points are increased portability and simpler logic, despite having to take care of LLVM thread safety quirks (see comments). Co-authored-by: Johannes Müller <[email protected]>
- Loading branch information
1 parent
5f018fc
commit c74f6bc
Showing
3 changed files
with
164 additions
and
98 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
require "./types" | ||
|
||
lib LibLLVM | ||
fun parse_bitcode_in_context2 = LLVMParseBitcodeInContext2(c : ContextRef, mb : MemoryBufferRef, m : ModuleRef*) : Int | ||
end |
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