Skip to content

Conversation

@Keno
Copy link
Member

@Keno Keno commented Dec 1, 2023

Addresses an outstanding todo from the KeyValue PR and allows (once all the PRs are merged), optimization when multiple ScopedValues are used with(a=>1, b=>2), etc. To facilitate this, in addition to the sroa adjustment, the ScopedValue code is adjusted to unroll the PersistentDict creation so that the optimizer can see the full chain (we do not support loops in the optimizer).

lifted_val = perform_lifting!(compact,
visited_philikes, key, result_t, lifted_leaves, collection, nothing)

compact[idx] = lifted_val === nothing ? nothing : Expr(:call, Core.tuple, lifted_val.val)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
compact[idx] = lifted_val === nothing ? nothing : Expr(:call, Core.tuple, lifted_val.val)
compact[idx] = lifted_val === nothing ? nothing : Expr(:call, GlobalRef(Core, :tuple), lifted_val.val)


compact[idx] = lifted_val === nothing ? nothing : Expr(:call, Core.tuple, lifted_val.val)
if lifted_val !== nothing
if !(𝕃ₒ, compact[SSAValue(idx)][:type], result_t)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if !(𝕃ₒ, compact[SSAValue(idx)][:type], result_t)
if !(𝕃ₒ, compact[SSAValue(idx)][:type], tuple_tfunc(𝕃ₒ, Any[result_t]))

It looks like it's invalid to use result_t here? compact[SSAValue(idx)][:type] would be something like Union{Nothing, Tuple{...}}.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch, thanks.

@Keno Keno force-pushed the kf/sroamultikeyvalue branch from d24374f to 53b0d8c Compare December 7, 2023 00:56
Addresses an outstanding todo from the KeyValue PR and allows
(once all the PRs are merged), optimization when multiple
ScopedValues are used `with(a=>1, b=>2)`, etc. To facilitate
this, in addition to the sroa adjustment, the ScopedValue
code is adjusted to unroll the PersistentDict creation so that
the optimizer can see the full chain (we do not support loops
in the optimizer).
@Keno Keno force-pushed the kf/sroamultikeyvalue branch from 53b0d8c to 220fc23 Compare December 7, 2023 20:33
@Keno Keno merged commit 1e20c9c into master Dec 8, 2023
@Keno Keno deleted the kf/sroamultikeyvalue branch December 8, 2023 01:02
Keno added a commit that referenced this pull request 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.
Keno added a commit that referenced this pull request Dec 19, 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.
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