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

sroa: Better walk for chained KeyValue #52542

Merged
merged 1 commit into from
Dec 19, 2023
Merged

sroa: Better walk for chained KeyValue #52542

merged 1 commit into from
Dec 19, 2023

Conversation

Keno
Copy link
Member

@Keno Keno commented Dec 15, 2023

This redoes #52369, to put the walk through tothe chained KeyValue into a more logical place (the definition walking). This way, we automatically inherit correct handling of PhiNodes and ifelse.

This redoes #52369, to put the walk through tothe chained KeyValue
into a more logical place (the definition walking). This way, we
automatically inherit correct handling of PhiNodes and ifelse.
@Keno Keno changed the title sroa: Better walk for chained KeyVlaue sroa: Better walk for chained KeyValue Dec 15, 2023
@staticfloat staticfloat requested a review from aviatesk December 18, 2023 18:19
@Keno Keno merged commit 4f25e87 into master Dec 19, 2023
8 checks passed
@Keno Keno deleted the kf/sroakvchainbetter branch December 19, 2023 11:24
Keno added a commit that referenced this pull request Dec 21, 2023
Fixes some mistakes in #52542 that led to the following issue:
```
function persistent_dict_elim_multiple_phi2(c::Bool)
           z = Base.inferencebarrier(1)::Int
           if c
               a = Base.PersistentDict(:a => z)
           else
               a = Base.PersistentDict(:a => z)
           end
           b = Base.PersistentDict(a, :b => 2)
           return b[:a]
end

julia> persistent_dict_elim_multiple_phi2(true)
ERROR: KeyError: key :a not found
Stacktrace:
 [1] getindex
   @ Base ./dict.jl:1010 [inlined]
 [2] persistent_dict_elim_multiple_phi2(c::Bool)
   @ Main ./REPL[1]:9
 [3] top-level scope
   @ REPL[3]:1
```

i.e. sroa incorrectly thought the value was not found.
Keno added a commit that referenced this pull request Dec 22, 2023
Fixes some mistakes in #52542 that led to the following issue:
```
function persistent_dict_elim_multiple_phi2(c::Bool)
           z = Base.inferencebarrier(1)::Int
           if c
               a = Base.PersistentDict(:a => z)
           else
               a = Base.PersistentDict(:a => z)
           end
           b = Base.PersistentDict(a, :b => 2)
           return b[:a]
end

julia> persistent_dict_elim_multiple_phi2(true)
ERROR: KeyError: key :a not found
Stacktrace:
 [1] getindex
   @ Base ./dict.jl:1010 [inlined]
 [2] persistent_dict_elim_multiple_phi2(c::Bool)
   @ Main ./REPL[1]:9
 [3] top-level scope
   @ REPL[3]:1
```

i.e. sroa incorrectly thought the value was not found.
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.

1 participant