]> git.eshelyaron.com Git - emacs.git/commitdiff
* Follow cstr basic blocks to perform latch recognition
authorAndrea Corallo <akrl@sdf.org>
Wed, 23 Dec 2020 10:47:36 +0000 (11:47 +0100)
committerAndrea Corallo <akrl@sdf.org>
Wed, 23 Dec 2020 11:03:39 +0000 (12:03 +0100)
* lisp/emacs-lisp/comp.el (comp-fwprop-insn): Fix latch
recognition.

lisp/emacs-lisp/comp.el

index 2f8587909e611cb3bf86b347917d9a052cd41018..485e5dc6ad2c77445364cbf6ee0ea9a8e42cffa5 100644 (file)
@@ -2540,9 +2540,12 @@ Fold the call in case."
     (`(phi ,lval . ,rest)
      (let* ((from-latch (cl-some
                          (lambda (x)
-                           (comp-latch-p
-                            (gethash (cdr x)
-                                     (comp-func-blocks comp-func))))
+                           (let* ((bb-name (cadr x))
+                                  (bb (gethash bb-name
+                                               (comp-func-blocks comp-func))))
+                             (or (comp-latch-p bb)
+                                 (when (comp-block-cstr-p bb)
+                                   (comp-latch-p (car (comp-block-preds bb)))))))
                          rest))
             (prop-fn (if from-latch
                          #'comp-cstr-union-no-range