-
Notifications
You must be signed in to change notification settings - Fork 0
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: Salt fm #25
Open
zbeekman
wants to merge
130
commits into
master
Choose a base branch
from
salt-fm
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
WIP: Salt fm #25
+2,694
−703
Conversation
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
It only needs to be done once from the main program...
These files were formerly used, but are no longer required after a previous code reorganization.
Add source to llvm-project/flang/examples/PrintFlangFunctionNames and attempt to build out of tree. Compiles and links but crashes when run.
Unlike Clang plugins, Flang plugins are *not* supposed to be linked against the Flang library. Remove link to flangFrontend, allow undefined symbols. The example plugin works now.
Fortran is case agnostic, but the tests for the C/C++ instrumentor check for uppercase injected instrumentation
It still needs a rework/refactor though... Writing a CMake find module for TAU would be nice to do someday.
- Splits handling of Pre and Post for ExecutionPart so that children (where ReturnStmt is found) are visited before writing the end instrumentation for the (sub)program. This ensures that instrumentation points are added in order. - Visit ExecutableConstruct and access ReturnStmt through it. This is necessary to get the source location because the location is held in a wrapper of ReturnStmt rather than in it directly.
Previously we would get a garbage value/exhibit undefined behavior if the source location was absent. Use checked value() to get value from std::optional, which checks if the value exists and throws an exception if not.
The procedure in the main program below the contains statement gets the wrong procedure name inserted in the instrumentation.
Previously assumed that a given line would have at most one instrumentation point before and at most one after, but in the case of a subprogram with only a single return statement, then that one line has three instrumentation points. Fixed by handling arbitrarily many before and after instrumentation points per line.
There is never executable code in Fortran interface blocks (which can end up being arbitrarily nested), so have the visitor skip descending into child nodes.
Change to if-then-endif with timer stop and return in body
Read and parse select files. Not yet acting on the directives.
Still need to add routine-level include/exclude, and tests for selective instrumentation.
The source location routines could be used for purposes other than instrumentation, so this commit moves them to a separate file and adds a header so they could be used other than in the instrumentor. Pass the parser as an argument so that they don't need to be inside the visitor class.
New classes added, but not yet hooked up to the instrumentor.
Instead of having a special case for If-Return constructs, there are now three locations: BEFORE, REPLACE, and AFTER. Instrumentation points for If-Return now uses REPLACE to replace a line of code.
Only outputs on error unless SALT_FORTRAN_VERBOSE is set to non-zero value. Set SALT_FORTRAN_VERBOSE in tests so that check for output succeeds.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
merge salt-fm into main branch once prototype is ready/fully functional