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

inference: form conditional constraint from non-Conditional object #40832

Merged
merged 1 commit into from
May 20, 2021

Conversation

aviatesk
Copy link
Member

We can form a conditional constraint from a branch condition itself
when its type isn't already Conditional but can be refined as
Conditional(condx, Const(true), Const(false)).

@aviatesk aviatesk requested a review from vtjnash May 15, 2021 13:18
@aviatesk aviatesk added the compiler:inference Type inference label May 15, 2021
We can form a conditional constraint from a branch condition itself
when its type isn't already `Conditional` but can be refined as
`Conditional(condx, Const(true), Const(false))`.
Copy link
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

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

It is potentially even stronger than this, if we could do stupdate! multiple times, but we'd need to keep a list of changes to be able to check if any of them made an update

condt = tmeet(condt, Bool)

                    newstate_else = stupdate!(states[l], StateUpdate(condx, VarState(Const(false), false), something(newstate_else, changes_else), false)
...
                    changes = stupdate!(states[pc´], StateUpdate(condx, VarState(Const(true), false), changes, false)
...

@aviatesk
Copy link
Member Author

That's better, yet I'd like to postpone to #40880 the discussion on how to apply multiple state updates.

@aviatesk aviatesk merged commit f77f4fe into JuliaLang:master May 20, 2021
@aviatesk aviatesk deleted the nonconditional branch May 20, 2021 11:23
aviatesk added a commit to aviatesk/julia that referenced this pull request May 22, 2021
aviatesk added a commit to aviatesk/julia that referenced this pull request May 23, 2021
aviatesk added a commit to aviatesk/julia that referenced this pull request May 24, 2021
aviatesk added a commit to aviatesk/julia that referenced this pull request May 27, 2021
aviatesk added a commit that referenced this pull request May 29, 2021
aviatesk added a commit to aviatesk/julia that referenced this pull request Jun 3, 2021
aviatesk added a commit to aviatesk/julia that referenced this pull request Jun 3, 2021
aviatesk added a commit to aviatesk/julia that referenced this pull request Jun 25, 2021
aviatesk added a commit to aviatesk/julia that referenced this pull request Sep 23, 2021
aviatesk added a commit to aviatesk/julia that referenced this pull request Sep 30, 2021
aviatesk added a commit to aviatesk/julia that referenced this pull request Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:inference Type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants