emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/native-comp e20cdf9: * lisp/emacs-lisp/comp.el (comp-fwprop-insn


From: Andrea Corallo
Subject: feature/native-comp e20cdf9: * lisp/emacs-lisp/comp.el (comp-fwprop-insn): Fix phi function.
Date: Sun, 8 Nov 2020 15:23:35 -0500 (EST)

branch: feature/native-comp
commit e20cdf937e74ebcaa2c6dabb63be1c20a6ea44f6
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>

    * lisp/emacs-lisp/comp.el (comp-fwprop-insn): Fix phi function.
---
 lisp/emacs-lisp/comp.el | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index c837e02..887a6a5 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]