diff options
author | Mattias EngdegÄrd <mattiase@acm.org> | 2023-01-18 18:36:29 +0100 |
---|---|---|
committer | Mattias EngdegÄrd <mattiase@acm.org> | 2023-02-02 14:46:53 +0100 |
commit | bfd338aad9d1e6bf898fc19d23e1a5ca4e696316 (patch) | |
tree | 47d30f360c777d747574e48b888ec417a912576a /lisp/emacs-lisp/lisp-mode.el | |
parent | f6955482c2933706229044c04d88b807b63a7095 (diff) | |
download | emacs-bfd338aad9d1e6bf898fc19d23e1a5ca4e696316.tar.gz emacs-bfd338aad9d1e6bf898fc19d23e1a5ca4e696316.tar.bz2 emacs-bfd338aad9d1e6bf898fc19d23e1a5ca4e696316.zip |
LAP peephole optimisation improvements
- Since discardN-preserve-tos(1) and stack-set(1) have the same
effect, treat them as equivalent in all transformations.
- Move the rule
discardN-preserve-tos(X) discardN-preserve-tos(Y)
--> discardN-preserve-tos(X+Y)
from the final pass to the main iteration since it may enable
further optimisations.
- Don't apply the rule
goto(X) ... X: DISCARD --> DISCARD goto(Y) ... X: DISCARD Y:
when DISCARD could be merged or deleted instead, which is even better.
- Add the rule
OP const return -> <deleted> const return
where OP is effect-free.
- Generalise the push-pop annihilation rule to
PUSH(K) discard(N) -> discard(N-K), N>K
PUSH(K) discard(N) -> <deleted>, N=K
to any N, not just N=1.
- Add the rule
OP goto(X) Y: OP X: -> <deleted> Y: OP X:
for any operation OP.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode):
Make the changes described above.
Diffstat (limited to 'lisp/emacs-lisp/lisp-mode.el')
0 files changed, 0 insertions, 0 deletions