diff options
| author | Andrea Corallo | 2020-12-31 11:27:53 +0100 |
|---|---|---|
| committer | Andrea Corallo | 2021-01-01 12:28:27 +0100 |
| commit | e81643bef500e1f1ec49d152f7db1ffc5a74ecd5 (patch) | |
| tree | 20efd7ee56f18d00ca702521637b90139174f452 | |
| parent | db2a49327a48a375cc2813d5211d762c5dfe55ff (diff) | |
| download | emacs-e81643bef500e1f1ec49d152f7db1ffc5a74ecd5.tar.gz emacs-e81643bef500e1f1ec49d152f7db1ffc5a74ecd5.zip | |
* Add `comp-insert-insn'
* lisp/emacs-lisp/comp.el (comp-insert-insn): New inline.
(comp-emit-call-cstr): Split logic and call `comp-insert-insn'.
| -rw-r--r-- | lisp/emacs-lisp/comp.el | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index b6ade0b99db..d7578fdcc07 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el | |||
| @@ -2391,16 +2391,21 @@ TARGET-BB-SYM is the symbol name of the target block." | |||
| 2391 | (comp-emit-assume 'and target-mvar cstr block-target negated)) | 2391 | (comp-emit-assume 'and target-mvar cstr block-target negated)) |
| 2392 | finally (cl-return-from in-the-basic-block))))))) | 2392 | finally (cl-return-from in-the-basic-block))))))) |
| 2393 | 2393 | ||
| 2394 | (defsubst comp-insert-insn (insn insn-cell) | ||
| 2395 | "Insert INSN as second insn of INSN-CELL." | ||
| 2396 | (let ((next-cell (cdr insn-cell)) | ||
| 2397 | (new-cell `(,insn))) | ||
| 2398 | (setf (cdr insn-cell) new-cell | ||
| 2399 | (cdr new-cell) next-cell | ||
| 2400 | (comp-func-ssa-status comp-func) 'dirty))) | ||
| 2401 | |||
| 2394 | (defun comp-emit-call-cstr (mvar call-cell cstr) | 2402 | (defun comp-emit-call-cstr (mvar call-cell cstr) |
| 2395 | "Emit a constraint CSTR for MVAR after CALL-CELL." | 2403 | "Emit a constraint CSTR for MVAR after CALL-CELL." |
| 2396 | (let* ((next-cell (cdr call-cell)) | 2404 | (let* ((new-mvar (make-comp-mvar :slot (comp-mvar-slot mvar))) |
| 2397 | (new-mvar (make-comp-mvar :slot (comp-mvar-slot mvar))) | ||
| 2398 | ;; Have new-mvar as LHS *and* RHS to ensure monotonicity and | 2405 | ;; Have new-mvar as LHS *and* RHS to ensure monotonicity and |
| 2399 | ;; fwprop convergence!! | 2406 | ;; fwprop convergence!! |
| 2400 | (new-cell `((assume ,new-mvar (and ,new-mvar ,mvar ,cstr))))) | 2407 | (insn `(assume ,new-mvar (and ,new-mvar ,mvar ,cstr)))) |
| 2401 | (setf (cdr call-cell) new-cell | 2408 | (comp-insert-insn insn call-cell))) |
| 2402 | (cdr new-cell) next-cell | ||
| 2403 | (comp-func-ssa-status comp-func) 'dirty))) | ||
| 2404 | 2409 | ||
| 2405 | (defun comp-lambda-list-gen (lambda-list) | 2410 | (defun comp-lambda-list-gen (lambda-list) |
| 2406 | "Return a generator to iterate over LAMBDA-LIST." | 2411 | "Return a generator to iterate over LAMBDA-LIST." |