Analysis Pass for Target Data Mapping for OpenMP 5.0 #1
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.
An Analysis pass, that prints the host/device memory copies introduced due to the target offloading clauses used by the programmer.
It follows the Omp Spec 5.0
This is a global/module level pass, that does interprocedural analysis to interpret the semantics of all the target offloading clauses.
First we analyze every function, and parse the arguments being passed to the Omp RTL calls, and extract the variables mapped, the map type and the array section.
Then we perform a global analysis to do a BFS traversal of every function basic block, and maintain the reference count, and interpret when the variable is copied from host to device and viceversa.
Checked in two lit test cases from the DRACC benchmark.
Use the following pass to test this analysis pass.
opt -S -passes='print-omp-diagnostics'