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

Print compilation stats about the MIR that was codegened in verbose mode #2420

Merged
merged 5 commits into from
May 2, 2023

Conversation

celinval
Copy link
Contributor

@celinval celinval commented May 2, 2023

Description of changes:

Adding a bit of information about the MIR that was used as an input to codegen to help us assess differences in performance that are due to changes in the MIR as opposed to changes in the kani-compiler.

I'm hoping this will help us spot differences when dealing with things like toolchain update.

The information will only be collected and printed if either --verbose is passed to Kani or if the user enables kani_compiler logs via KANI_LOG. It will look like:

====== Reachability Analysis Result =======
Total # items: 627
Total # statements: 6035
Total # expressions: 2922

Reachable Items:
  - static item: 1
  - function: 626

Statements:
  - Call: 1508
  - Intrinsic: 22
  - Assign: 2922
  - Assert: 208
  - Goto: 278
  - SwitchInt: 389
  - Unreachable: 59
  - Drop: 37
  - Return: 612

Expressions:
  - Ref: 328
  - BinaryOp: 300
  - Cast: 224
  - Discriminant: 102
  - CopyForDeref: 24
  - Len: 30
  - CheckedBinaryOp: 166
  - AddressOf: 33
  - NullaryOp: 13
  - Repeat: 1
  - Aggregate: 316
  - UnaryOp: 233
  - Use: 1152

-------------------------------------------

Resolved issues:

N/A

Related RFC:

Optional #ISSUE-NUMBER.

Call-outs:

I'm planning to publish a separate PR for adding stats about the generated goto.

Testing:

  • How is this change tested?

  • Is this a refactor change?

Checklist

  • Each commit message has a non-empty body, explaining why the change was made
  • Methods or procedures are documented
  • Regression or unit tests are included, or existing tests cover the modified code
  • My PR is restricted to a single feature or bugfix

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

@celinval celinval requested a review from a team as a code owner May 2, 2023 01:29
@celinval
Copy link
Contributor Author

celinval commented May 2, 2023

Ooops... I forgot to adapt this change when I cherry-picked from the toolchain upgrade branch.

Copy link
Contributor

@adpaco-aws adpaco-aws left a comment

Choose a reason for hiding this comment

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

Can you please add this contribution to the CHANGELOG.md file? I'd like to include it in the release.

@celinval
Copy link
Contributor Author

celinval commented May 2, 2023

Can you please add this contribution to the CHANGELOG.md file? I'd like to include it in the release.

Done!

@tautschnig thanks for the typos fix. :)

@celinval celinval changed the title Add a bit of stats about the MIR that was codegened Print compilation stats about the MIR that was codegened in verbose mode May 2, 2023
@celinval celinval enabled auto-merge (squash) May 2, 2023 16:35
@celinval celinval merged commit f98b40a into model-checking:main May 2, 2023
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.

3 participants