diff options
author | Andrea Corallo <akrl@sdf.org> | 2020-11-08 20:45:43 +0100 |
---|---|---|
committer | Andrea Corallo <akrl@sdf.org> | 2020-11-08 21:22:53 +0100 |
commit | e20cdf937e74ebcaa2c6dabb63be1c20a6ea44f6 (patch) | |
tree | 6906f11e9ac18a38cbd303f1c2e36940f0933f60 | |
parent | a5408d5715de5ee9b6858c6eb0638043f4cdb136 (diff) | |
download | emacs-e20cdf937e74ebcaa2c6dabb63be1c20a6ea44f6.tar.gz emacs-e20cdf937e74ebcaa2c6dabb63be1c20a6ea44f6.tar.bz2 emacs-e20cdf937e74ebcaa2c6dabb63be1c20a6ea44f6.zip |
* lisp/emacs-lisp/comp.el (comp-fwprop-insn): Fix phi function.
-rw-r--r-- | lisp/emacs-lisp/comp.el | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index c837e020603..887a6a503ec 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -2289,19 +2289,20 @@ Forward propagate immediate involed in assignments." (setf (comp-mvar-const-vld lval) t (comp-mvar-constant lval) v (comp-mvar-type lval) (comp-strict-type-of v))) - (`(phi (,lval . _) . ,rest) - ;; Forward const prop here. - (when-let* ((vld (cl-every #'comp-mvar-const-vld rest)) - (consts (mapcar #'comp-mvar-constant rest)) - (x (car consts)) - (equals (cl-every (lambda (y) (equal x y)) consts))) - (setf (comp-mvar-const-vld lval) t - (comp-mvar-constant lval) x)) - ;; Forward type propagation. - (when-let* ((types (mapcar #'comp-mvar-type rest)) - (non-empty (cl-notany #'null types)) - (x (comp-common-supertype types))) - (setf (comp-mvar-type lval) x))))) + (`(phi ,lval . ,rest) + (let ((rvals (mapcar #'car rest))) + ;; Forward const prop here. + (when-let* ((vld (cl-every #'comp-mvar-const-vld rvals)) + (consts (mapcar #'comp-mvar-constant rvals)) + (x (car consts)) + (equals (cl-every (lambda (y) (equal x y)) consts))) + (setf (comp-mvar-const-vld lval) t + (comp-mvar-constant lval) x)) + ;; Forward type propagation. + (when-let* ((types (mapcar #'comp-mvar-type rvals)) + (non-empty (cl-notany #'null types)) + (x (comp-common-supertype types))) + (setf (comp-mvar-type lval) x)))))) (defun comp-fwprop* () "Propagate for set* and phi operands. |