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

implement inlining for call attributes #980

Merged
merged 5 commits into from
Nov 8, 2024

Conversation

typerSniper
Copy link
Contributor

Description

This PR implements support for inlining based on call sites, while maintaining the behavior of inlining based on procedure definitions. When there is a clash, the inlining depth specified at the call site "wins", because its more precise.

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

atomb
atomb previously approved these changes Nov 7, 2024
Copy link
Collaborator

@atomb atomb left a comment

Choose a reason for hiding this comment

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

This looks nice. I made a couple of stylistic comments, but feel free to take them or leave them.


public int getDepth(Implementation impl) {
var procName = getName(impl);
var c = -1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this line is redundant. You could probably use out var c in the line below and leave this line out.

Copy link
Contributor Author

@typerSniper typerSniper Nov 8, 2024

Choose a reason for hiding this comment

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

Oh i didn't know that writing out var c defines c.

Source/Core/Inline.cs Outdated Show resolved Hide resolved
@atomb atomb merged commit 20e2656 into boogie-org:master Nov 8, 2024
5 checks passed
protected Dictionary<string, int> procUnrollDepth = new();
protected Dictionary<string, CallCmd> procUnrollSrc = new();

private string getName (Implementation impl) {
Copy link
Collaborator

@keyboardDrummer keyboardDrummer Nov 8, 2024

Choose a reason for hiding this comment

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

Please remove the redundant space and use PascalCase for method names, as is the C# convention. If you use a C# IDE then it'll alert you to the incorrect name. We should add a stylistic checker to the Boogie CI

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