Loop execution modes in trm_for #32
Merged
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 adds a field to trm_for indicating the execution mode (sequential, parallel, etc.) Previously a parallel loop was only indicated by an OpenMP pragma annotation, which was not guaranteed to be preserved by transformations, nor was it recognized by the typechecker itself (parallel for correctness was only checked at the time of the transformation).
The intention of adding this field is to track the execution mode of a loop in a way that will be preserved by transformations, so that the typechecker can validate at each step that the requirements of that mode are still correct. This is needed especially for more complicated execution mode proposals like
thread forwhere the typechecker has more work to do to validate the loop (so it does not make sense for transformations to check.)Since the validation of the parallel for (no sequential invariant) is now performed by the typechecker the transformations don't perform any extra validation as a result of this PR, they just preserve the mode whenever transforming a loop. In cases like loop fusion, they just check that the two loops have the same mode. A loop constructed using the
trm_forsmart constructor defaults to aSequentialloop.TODO: