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

don't splat into _apply calls #134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

don't splat into _apply calls #134

wants to merge 1 commit into from

Conversation

vchuravy
Copy link
Member

In vchuravy/GPUifyLoops.jl#88 I noticed that calls like f(a, b, args...) = Core._apply(g, (a, b), args...)
where not being inlined, whereas f(a, b, args...) = Core._apply(f, (a, b), args) will be inlined.

@jrevels I am not sure if that impacts any of the _apply handling in overdub.jl.

@vchuravy
Copy link
Member Author

using Cassette
using InteractiveUtils

Cassette.@context Ctx

g(x, y, args...) = args
f(x, y, args...) = Cassette.overdub(Ctx(), Core._apply, g, x, y, args...)
@show @code_typed f(1, 2)

Before:

➜  experiments git:(master) ✗ ~/builds/julia/julia apply.jl
#= /home/vchuravy/src/experiments/apply.jl:8 =# @code_typed(f(1, 2)) = CodeInfo(
1 ─ %1 = Core._apply::typeof(Core._apply)
│   %2 = (%1)(Cassette.overdub, (Cassette.Context{nametype(Ctx),Nothing,Nothing,getfield(Cassette, Symbol("##PassType#399")),Nothing,Nothing}(nametype(Ctx)(), nothing, nothing, getfield(Cassette, Symbol("##PassType#399"))(), nothing, nothing), g), x, y)::Tuple{}
└──      return %2
) => Tuple{}

After:

➜  experiments git:(master) ✗ ~/builds/julia/julia apply.jl
#= /home/vchuravy/src/experiments/apply.jl:8 =# @code_typed(f(1, 2)) = CodeInfo(
1 ─     return ()
) => Tuple{}

But apparently it breaks other things right now.

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.

None yet

1 participant