Conversation
michael-schwarz
approved these changes
Sep 16, 2022
Member
|
Interesting, wouldn't have expected this to ever matter relative to the runtime of all the rest of the code! |
Member
Author
|
I saw this on a small SV-COMP program with a large number of witness invariants to unassume. The latter is also avoided in goblint/analyzer#827, so in the grand scheme of things, this might become insignificant. |
sim642
added a commit
to sim642/opam-repository
that referenced
this pull request
Nov 23, 2022
CHANGES: * Fix scope of enum definition in return type (goblint/cil#112, goblint/cil#113). * Fix signed integer left shift constant folding overflow (goblint/cil#122, goblint/cil#123). * Fix `fitsInInt` for booleans (goblint/cil#111). * Mark more loop statement locations synthetic (goblint/cil#125). * Optimize integer truncation (goblint/cil#115). * Fix FrontC and Cabs2cil partial application (goblint/cil#116). * Fix external usage of `freshLabel` (goblint/cil#121).
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.
While profiling I noticed
Cil.truncateCilinttaking unusually much time computing these powers. In most cases this probably makes no difference but in the case where I noticed this, it was ~10% of the time. The truncation function is indirectly involved in a number of CIL things, including constant folding.Microbenchmarks confirm that using left shifts to compute these powers is 5 to 182 times faster, depending on the shift amount:
Details