Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces memoization for CIL field offset computations to avoid repeated expensive Cil.bitsOffset calls, addressing #1964.
Changes:
- Updated
GobHashtbl.find_or_add_default_delayedto pass the key to thedefaultthunk. - Added cached
Cilfacade.fieldBitsOffsetOnly/fieldBytesOffsetOnlyhelpers and ensured the cache is cleared inCilfacade.reset_lazy. - Switched multiple call sites to use the cached field offset helpers instead of recomputing offsets.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/util/std/gobHashtbl.ml |
Changes find_or_add_default_delayed to provide the lookup key to the default function. |
src/framework/xsltResultOutput.ml |
Adapts find_or_add_default_delayed call sites to the new default signature. |
src/common/util/cilfacade.ml |
Adds field offset caching and resets it via reset_lazy. |
src/cdomains/unionFind.ml |
Uses cached field bit offsets when mapping bit offsets back to struct fields. |
src/cdomain/value/cdomains/offset.ml |
Uses cached field bit offsets in offset-to-index computation (incl. bitfield handling). |
src/analyses/memOutOfBounds.ml |
Uses cached field byte offsets for field offset conversion. |
src/analyses/base.ml |
Uses cached field byte offsets for container_of-style offset cancellation logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
Author
|
This speeds up rsync analysis by ~20% (on top of the CIL |
Member
Author
There's no impact on sv-benchmarks: #tum-nightly-svcomp > commit 82ff50a. |
2 tasks
This file contains hidden or 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
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.
Closes #1964.
TODO