Skip to content

Move and cleanup declarations of C compiler intrinsics #6707

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

Merged

Conversation

tautschnig
Copy link
Collaborator

Please review commit-by-commit: the main added value is a new script that fetches Clang's declarations. The remaining commits are cleanup to facilitate easier updates of these intrinsics in future.

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@tautschnig tautschnig requested a review from kroening as a code owner March 4, 2022 16:11
@tautschnig tautschnig requested a review from chris-ryder as a code owner March 4, 2022 16:11
@tautschnig tautschnig force-pushed the feature/clang-builtins-fetcher branch from d45b127 to 388f47d Compare March 4, 2022 16:17
@tautschnig tautschnig requested a review from a team as a code owner March 4, 2022 16:17
@tautschnig tautschnig force-pushed the feature/clang-builtins-fetcher branch 3 times, most recently from 063e58f to 964b863 Compare March 4, 2022 16:57
Copy link
Contributor

@NlightNFotis NlightNFotis left a comment

Choose a reason for hiding this comment

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

Sorry, question here because I cannot put it into a comment on the code (doesn't seem appropriate).

This appears to be adding a python script to print the compiler intrinsics from clang. It also mentions (on one of the commit messages) that this is supposed to substitute for an older script, but I don't see the older one being deleted anywhere.

Is this a mistake, or are both supposed to be used? Or is my understanding of the situation wrong?

@tautschnig
Copy link
Collaborator Author

Sorry, question here because I cannot put it into a comment on the code (doesn't seem appropriate).

This appears to be adding a python script to print the compiler intrinsics from clang. It also mentions (on one of the commit messages) that this is supposed to substitute for an older script, but I don't see the older one being deleted anywhere.

Is this a mistake, or are both supposed to be used? Or is my understanding of the situation wrong?

My apologies, I'll try to clarify the commit message: it's not really a substitute as the existing (bash) script fetches declarations from GCC's repository, while the new Python script fetches Clang's declarations. These declarations overlap to a great extent, but aren't completely the same. That said, however, the GCC script is rather brittle. Perhaps removing that script actually is the right thing to do. For now I'll just amend the commit message, but we might consider removing the bash script.

@tautschnig tautschnig force-pushed the feature/clang-builtins-fetcher branch from 964b863 to f0681d6 Compare March 4, 2022 19:43
@codecov
Copy link

codecov bot commented Mar 4, 2022

Codecov Report

Base: 78.34% // Head: 78.34% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (371d886) compared to base (a53fa0f).
Patch coverage: 93.33% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #6707   +/-   ##
========================================
  Coverage    78.34%   78.34%           
========================================
  Files         1644     1645    +1     
  Lines       190313   190358   +45     
========================================
+ Hits        149097   149133   +36     
- Misses       41216    41225    +9     
Impacted Files Coverage Δ
jbmc/src/janalyzer/janalyzer_parse_options.cpp 48.58% <ø> (ø)
.../src/java_bytecode/character_refine_preprocess.cpp 54.27% <ø> (ø)
...mc/src/java_bytecode/character_refine_preprocess.h 100.00% <ø> (ø)
jbmc/src/java_bytecode/ci_lazy_methods.h 100.00% <ø> (ø)
jbmc/src/java_bytecode/ci_lazy_methods_needed.cpp 98.41% <ø> (ø)
jbmc/src/java_bytecode/ci_lazy_methods_needed.h 100.00% <ø> (ø)
jbmc/src/java_bytecode/code_with_references.cpp 84.61% <ø> (ø)
jbmc/src/java_bytecode/java_bmc_util.cpp 100.00% <ø> (ø)
...mc/src/java_bytecode/java_bytecode_convert_class.h 0.00% <ø> (ø)
...src/java_bytecode/java_bytecode_convert_method.cpp 97.69% <ø> (ø)
... and 403 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@tautschnig tautschnig force-pushed the feature/clang-builtins-fetcher branch from f0681d6 to 2935c26 Compare March 4, 2022 22:04
@tautschnig tautschnig self-assigned this Nov 4, 2022
@tautschnig tautschnig force-pushed the feature/clang-builtins-fetcher branch from 2935c26 to 3b8a786 Compare November 8, 2022 10:18
@tautschnig tautschnig requested a review from nwetzler November 8, 2022 10:19
@tautschnig tautschnig assigned nwetzler and unassigned tautschnig Nov 8, 2022
@tautschnig tautschnig self-assigned this Nov 20, 2022
This is to make them easier to distinguish from any other header files:
the declarations located in these files may need to be updated from time
to time. The frequency of those updates, however, depends on the release
cadence by other compilers. It is unrelated to our release cadence.
Thus far, we constructed most of the declarations using the
get-gcc-builtins.sh script. We may need to continue to do so for GCC.

Clang's declarations, however, seem easier to parse. This new script now
takes care of this.

In future, we may decide to completely remove the GCC-specific script,
and build upon Clang's declarations with selective tweaks instead.
We did not consistently use (void) as the parameter type declaration.
To simplify textual comparison of declarations generated by
clang_builtins.py and the existing ones, add "int" to types "unsigned,"
"long long," etc.
@tautschnig tautschnig force-pushed the feature/clang-builtins-fetcher branch from 3b8a786 to 371d886 Compare November 21, 2022 10:42
@tautschnig tautschnig removed their assignment Nov 21, 2022
Copy link
Contributor

@TGWDB TGWDB left a comment

Choose a reason for hiding this comment

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

I'm approving with the following caveats:

  1. Adding a new script seems philosophically dangerous, now we have multiple places to gather the data we need
  2. I don't think any of this is (well?) tested...
  3. While it looks ok to me, I'm not really an expect in the compiler intrinsics area

@tautschnig
Copy link
Collaborator Author

I'm approving with the following caveats:

1. Adding a new script seems philosophically dangerous, now we have multiple places to gather the data we need

2. I don't think any of this is (well?) tested...

3. While it looks ok to me, I'm not really an expect in the compiler intrinsics area

Points taken. Maybe we can one day try to come up with a better story for compiler intrinsics. At the moment, this certainly is just a best-effort and not very organised activity.

@peterschrammel peterschrammel removed their assignment Dec 8, 2022
@tautschnig tautschnig merged commit a108335 into diffblue:develop Dec 8, 2022
@tautschnig tautschnig deleted the feature/clang-builtins-fetcher branch December 8, 2022 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants