This repository was archived by the owner on Jun 21, 2024. It is now read-only.
Inlining loads in the native code#251
Merged
kayceesrk merged 5 commits intoocaml-multicore:masterfrom Jun 28, 2019
Merged
Conversation
Changed the representation of the cmm-op Cloadmut to be a record from a tuple. Replaced all occurences of values of type Cloadmut and pattern matching on Cloadmut to make use of the record representation
2613930 to
2787e67
Compare
Cloadmut has been extended with is_atomic flag to be used further in the emit-mlp stage to set-up read barriers on atomic accesses
Patomic_load has been modified with immediate_or_pointer field to use while emitting asm for atomic loads
Patomic_load was emitting an extcall to caml_atomic_load. Now depending on the immediate_or_pointer parameter, it emits Cload or Cloadmut which gets lowered to assembly rather than extcall
2787e67 to
6e0089c
Compare
kayceesrk
reviewed
Jun 26, 2019
kayceesrk
reviewed
Jun 26, 2019
kayceesrk
reviewed
Jun 26, 2019
kayceesrk
suggested changes
Jun 26, 2019
Changed the record syntax in mutiple places
kayceesrk
approved these changes
Jun 28, 2019
Contributor
|
Awesome. I'll merge it once the CI passes. |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR aims to fix #237.
Atomic.getis a library function that provides atomic reads across domains. Onx86, these atomic reads emit an external function call -caml_atomic_load. This function loads a value and emits aread_barrierto prevent re-ordering from happening.The external call is unnecessary, and on
x86, can be translated to plain loads.TODO:
Patomic_loadwith animmediate_or_pointerfieldCloadandCloadmutto use inline records instead of tuplesCloadandCloadmutwithis_atomicfieldPatomic_loadtoCload {}orCload {}Iloadmutinstead ofcaml_atomic_loadChanges
Extending
Patomic_loadwith animmediate_or_pointerfieldPatomic_loadis a lambda op, which has been extended with a field to denote whether that load is to a value or an immediate.to
Changing
CloadandCloadmutto use records instead of tuplesCloadandCloadmutare twocmmoperations defined as -This has now been modified to be -
All occurring values and usage in pattern matching has been updated to the new representation
Emitting
CloadorCloadmutfromPatomic_loadThe
cmmgen.mlfile emits cmm from lambda expressions. For this, the pattern match has been modified as -to
Emit Iloadmut instead of caml_atomic_load
In
selectgen.ml, theCloadandCloadmutare translated toiloadandiloadmut. In x86, theis_atomicparam is ignored.