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

effects: separate :noub effect bit from :consistent #50808

Merged
merged 1 commit into from
Aug 19, 2023
Merged

Commits on Aug 19, 2023

  1. effects: separate :noub effect bit from :consistent

    The current `:consistent` effect bit carries dual meanings:
    1. "the return value is always consistent"
    2. "this method does not cause any undefined behavior".
    
    This design makes the effect bit unclear and hard to manage.
    Specifically, the current design prevents a post-inference analysis
    (as discussed in #50805) from safely refining
    `:consistent`-cy using post-optimization state IR. This is because it is
    impossible to tell whether the `:consistent`-cy has been tainted by the
    first or second meaning.
    
    To address this, this commit splits them into two distinct effect bits:
    `:consistent` for consistent return values and `:noub` for no undefined
    behavior.
    
    This commit also introduces an override mechanism for `:noub` as it is
    necessary for `@assume_effects` to concrete-evaluate the annotated
    methods. While this might sound risky and not in line with the existing
    designs of `:nonoverlayed` and `:noinbounds`, where their overrides are
    prohibited, but we already have an override mechanism in place for
    `:consistent`, which implicitly overrides `:noub`. Given this precedent,
    the override for `:noub` should probably be justified.
    aviatesk committed Aug 19, 2023
    Configuration menu
    Copy the full SHA
    6b6334a View commit details
    Browse the repository at this point in the history