aviatesk / JET.jl

An experimental code analyzer for Julia. No need for additional type annotations.
https://aviatesk.github.io/JET.jl/dev/
MIT License
739 stars 30 forks source link

`JET.@report_trim` or similar to find issues that would prevent trimming #651

Open KristofferC opened 2 months ago

KristofferC commented 2 months ago

JET.@report_opt shows more things than are needed for trimming to work. A useful mode could be to restrict the printed things to only those that would prevent trimming.

timholy commented 2 months ago

In the long run this could be hard to do. I think it's likely that trimming may ultimately include changes to the specialization heuristics and that might be difficult to mimic in a standard interactive session. Nevertheless the general idea is excellent, and getting at least close seems well worth the attempt.

The main practical obstacle is that currently the notion of "If a call is too dynamic to reasonably narrow down the possible call targets" requires reading the source of https://github.com/JuliaLang/julia/pull/55047 to make sufficiently concrete (straightforward, but might be best to wait until it merges).