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

Dbg def use #886

Merged
merged 15 commits into from
Oct 14, 2021
Merged

Dbg def use #886

merged 15 commits into from
Oct 14, 2021

Conversation

robdockins
Copy link
Contributor

No description provided.

We now compute sucessor and predecessor blocks and perform def/use
analysis for each basic block.  This def/use analysis specifically
omits values embedded in metadata nodes in order to help us
discover which debugging intrinsics need to be specially handled.
CFG is valid. This ensures that all non-metadata uses of virtual
registers are proper, i.e., that their def sites dominate all
use sites.

In addition, track the set of live virtual registers during
translation.  This allows us to check which metadata values
are properly defined as we translate them, in particular, for
debugging intrinsics.  Since these intrinsics don't necessarily
follow the usual rules regarding use/def, it can sometimes happen
that metadata values are not properly defined.  In such cases
we simply omit the ill-formed debugging intrinsic information.

Fixes #798
@robdockins robdockins marked this pull request as ready for review October 13, 2021 23:40
Copy link
Contributor

@RyanGlScott RyanGlScott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is exciting! I have not read every line thoroughly, but if the example from #778 works, I'm happy.

crucible-llvm/src/Lang/Crucible/LLVM/Translation.hs Outdated Show resolved Hide resolved
crux-llvm/src/Crux/LLVM/Log.hs Outdated Show resolved Hide resolved
@@ -219,7 +219,7 @@ translateLLVMModule ::
IO SomeModuleContext'
translateLLVMModule llOpts halloc memVar moduleFilePath llvmMod =
do
Some trans <-
(Some trans, _warns) <- -- TODO? should we do something with these warnings?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about this, @langston-barrett? Should uc-crux-llvm emit warnings discovered during translation?

robdockins and others added 5 commits October 13, 2021 17:28
typos and such

Co-authored-by: Ryan Scott <[email protected]>
…form.

Refactor slightly how function calls are translated.  All code paths
would enter their monadic continuation, so pull it back into
`generateInstr`.
crucible-llvm/src/Lang/Crucible/LLVM/Translation/Monad.hs Outdated Show resolved Hide resolved
crux-llvm/src/Crux/LLVM/Log.hs Show resolved Hide resolved
@robdockins
Copy link
Contributor Author

I've verified locally that the program from #778 now works as expected. When debug-intrinsics are enabled, we get the expected warning about def/use violation in debug metadata and the program is accepted.

@robdockins robdockins merged commit 29e4df4 into master Oct 14, 2021
brianhuffman pushed a commit to GaloisInc/saw-script that referenced this pull request Oct 25, 2021
This adds a new translation-warnings output to function
`translateModule`. Currently the translation warnings are ignored.
brianhuffman pushed a commit to GaloisInc/saw-script that referenced this pull request Nov 12, 2021
This adds a new translation-warnings output to function
`translateModule`. Currently the translation warnings are ignored.
brianhuffman pushed a commit to GaloisInc/saw-script that referenced this pull request Nov 12, 2021
This adds a new translation-warnings output to function
`translateModule`. Currently the translation warnings are ignored.
@travitch travitch deleted the dbg-def-use branch August 5, 2022 17:10
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.

None yet

2 participants