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

Disable code emitting heap-dependent triggers if verified member does not use them #651

Merged
merged 9 commits into from
Nov 1, 2022

Conversation

marcoeilers
Copy link
Contributor

@marcoeilers marcoeilers commented Oct 26, 2022

This PR adds code that checks for which fields, predicates and wands the currently verified member uses resource triggers. For all resources not used as triggers, it disables all code in Silicon that emits those triggers and, in particular, prevents Silicon from emitting snapshot maps etc. that are required only for those triggers.

Its purpose is to improve performance for Viper code that does not use such triggers, in particular, Gobra-generated code used in the VerifiedSCION project, which reportedly gets a big performance improvement from disabling them.

The state consolidator uses field triggers when emitting a quantifier stating that for all fields, the permission amount is at most one; for fields not used in field triggers, this code is changed to use different triggers instead (since the field triggers wouldn't work).

@marcoeilers marcoeilers changed the title Add a flag to disable code emitting heap-dependent trigger expressions Disable code emitting heap-dependent triggers if verified program does not use them Oct 26, 2022
@marcoeilers marcoeilers marked this pull request as draft October 27, 2022 01:06
…nt member; state consolidation uses alternative quantifier that does not require field trigger
@marcoeilers marcoeilers changed the title Disable code emitting heap-dependent triggers if verified program does not use them Disable code emitting heap-dependent triggers if verified member does not use them Oct 27, 2022
@marcoeilers marcoeilers marked this pull request as ready for review October 27, 2022 16:37
Copy link
Contributor

@jcp19 jcp19 left a comment

Choose a reason for hiding this comment

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

As may be clear from my very noob question, I'm not yet super comfortable with the silicon codebase. Nonetheless, I did not find any obvious mistakes and would be very glad to have this as soon as possible for SCION.

src/main/scala/rules/Consumer.scala Show resolved Hide resolved
@marcoeilers marcoeilers merged commit 228387a into master Nov 1, 2022
@marcoeilers marcoeilers deleted the meilers_no_heap_dep_triggers branch November 1, 2022 20:56
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.

2 participants