Skip to content
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
wants to merge 130 commits into
base: master
Choose a base branch
from
Open

WIP: Salt fm #25

wants to merge 130 commits into from

Conversation

zbeekman
Copy link
Member

merge salt-fm into main branch once prototype is ready/fully functional

zbeekman and others added 30 commits November 26, 2024 14:12
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.
zbeekman and others added 30 commits December 15, 2024 16:08
- 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants