diff options
| author | Mattias EngdegÄrd | 2023-01-17 17:57:25 +0100 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2023-01-27 17:27:15 +0100 |
| commit | 627ac228b2ecdf179f36ea41fd0254c091744e4b (patch) | |
| tree | a0edd595805a2d8a181eab2c0e58cfa480ba3bdf | |
| parent | 18fbcce9757165689df109db8f7b528a57335ae2 (diff) | |
| download | emacs-627ac228b2ecdf179f36ea41fd0254c091744e4b.tar.gz emacs-627ac228b2ecdf179f36ea41fd0254c091744e4b.zip | |
Don't inhibit LAP-level DCE when switch ops are present
* lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode):
Allow removal of unreachable basic blocks in the LAP peephole
optimiser even when switch ops are present. The origins of
this apparently unnecessary condition are unclear.
| -rw-r--r-- | lisp/emacs-lisp/byte-opt.el | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 039cebedb44..b1a46d520e6 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el | |||
| @@ -2227,18 +2227,12 @@ If FOR-EFFECT is non-nil, the return value is assumed to be of no importance." | |||
| 2227 | ;; | 2227 | ;; |
| 2228 | ;; goto ... --> goto <delete until TAG or end> | 2228 | ;; goto ... --> goto <delete until TAG or end> |
| 2229 | ;; return ... --> return <delete until TAG or end> | 2229 | ;; return ... --> return <delete until TAG or end> |
| 2230 | ;; (unless a jump-table is being used, where deleting may affect | ||
| 2231 | ;; other valid case bodies) | ||
| 2232 | ;; | 2230 | ;; |
| 2233 | ((and (memq (car lap0) '(byte-goto byte-return)) | 2231 | ((and (memq (car lap0) '(byte-goto byte-return)) |
| 2234 | (not (memq (car lap1) '(TAG nil))) | 2232 | (not (memq (car lap1) '(TAG nil)))) |
| 2235 | ;; FIXME: Instead of deferring simply when jump-tables are | ||
| 2236 | ;; being used, keep a list of tags used for switch tags and | ||
| 2237 | ;; use them instead (see `byte-compile-inline-lapcode'). | ||
| 2238 | (not byte-compile-jump-tables)) | ||
| 2239 | (setq tmp rest) | 2233 | (setq tmp rest) |
| 2240 | (let ((i 0) | 2234 | (let ((i 0) |
| 2241 | (opt-p (memq byte-optimize-log '(t lap))) | 2235 | (opt-p (memq byte-optimize-log '(t byte))) |
| 2242 | str deleted) | 2236 | str deleted) |
| 2243 | (while (and (setq tmp (cdr tmp)) | 2237 | (while (and (setq tmp (cdr tmp)) |
| 2244 | (not (eq 'TAG (car (car tmp))))) | 2238 | (not (eq 'TAG (car (car tmp))))) |