Right now @analyze_lifetimes tracks slices as well as other temporaries. However, it assumes un-fused broadcasting and will probably break things if used on a fused broadcast.
I think it would be good to have a more specific escape analysis pass that just looks at array slices as these can be contained in broadcast expressions.
For example,
@gc_slices begin
a[1:5] .= b[1:5] .- c[1:5]
end
would eagerly collect only the slice objects.
To implement this I think we could have the @analyze_lifetimes code just call this new macro as one of its passes.
Right now
@analyze_lifetimestracks slices as well as other temporaries. However, it assumes un-fused broadcasting and will probably break things if used on a fused broadcast.I think it would be good to have a more specific escape analysis pass that just looks at array slices as these can be contained in broadcast expressions.
For example,
would eagerly collect only the slice objects.
To implement this I think we could have the
@analyze_lifetimescode just call this new macro as one of its passes.