GNU bug report logs -
#42147
28.0.50; pure vs side-effect-free, missing optimizations?
Previous Next
Reported by: Andrea Corallo <andrea_corallo <at> yahoo.it>
Date: Tue, 30 Jun 2020 22:28:02 UTC
Severity: normal
Found in version 28.0.50
Done: Mattias Engdegård <mattiase <at> acm.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Mattias Engdegård <mattiase <at> acm.org> writes:
> 7 juli 2020 kl. 18.24 skrev Andrea Corallo <andrea_corallo <at> yahoo.it>:
>
>> Sure I'm. The native compiler does it already but I'm curious to see
>> how you do it at source level and how generic it is.
>
> Not very, but doing it at source level has some advantages since it can enable other source-level transformations.
> It's mainly a proof of concept -- for simplicity, it doesn't attempt to be overly clever in the face of loops or setq.
>
> One snag is that because Emacs inline functions (defsubst) are inlined
> as bytecode, they are usually not amenable to source optimisations. It
> is only when a defsubst is imported from a different .el file that has
> not yet been byte-compiled that it is integrated as source, and then
> the machinery in this patch will nicely propagate constant arguments
> into the body.
Well loops and setq without CFG IMO are likely to be difficult if not
impossible to optimize in a generic way. But I agree that having a
simple optimization done earlier is always better given it can benefit
other ones.
Andrea
This bug report was last modified 4 years and 281 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.