emacs-diffs
[Top][All Lists]
Advanced

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

feature/native-comp 2a8a3a9 1/4: Use `sxhash-eq' to generate mvar SSA id


From: Andrea Corallo
Subject: feature/native-comp 2a8a3a9 1/4: Use `sxhash-eq' to generate mvar SSA ids
Date: Sun, 16 Feb 2020 12:47:11 -0500 (EST)

branch: feature/native-comp
commit 2a8a3a9f28a6b1404161512115b059a376bc07f0
Author: Andrea Corallo <address@hidden>
Commit: Andrea Corallo <address@hidden>

    Use `sxhash-eq' to generate mvar SSA ids
---
 lisp/emacs-lisp/comp.el | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 9a782f7..b6c1a95 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -271,18 +271,11 @@ structure.")
                  :documentation "Generates block numbers.")
   (edge-cnt-gen (funcall #'comp-gen-counter) :type function
                 :documentation "Generates edges numbers.")
-  (ssa-cnt-gen (funcall #'comp-gen-counter) :type function
-               :documentation "Counter to create ssa limple vars.")
   (has-non-local nil :type boolean
                  :documentation "t if non local jumps are present.")
   (array-h (make-hash-table) :type hash-table
            :documentation "array idx -> array length."))
 
-(defun comp-func-reset-generators (func)
-  "Reset unique id generators for FUNC."
-  (setf (comp-func-edge-cnt-gen func) (comp-gen-counter)
-        (comp-func-ssa-cnt-gen func) (comp-gen-counter)))
-
 (cl-defstruct (comp-mvar (:constructor make--comp-mvar))
   "A meta-variable being a slot in the meta-stack."
   (slot nil :type (or fixnum symbol)
@@ -1254,9 +1247,12 @@ Top-level forms for the current context are rendered 
too."
 ;; This pass should be run every time basic blocks or m-var are shuffled.
 
 (cl-defun make-comp-ssa-mvar (&key slot (constant nil const-vld) type)
-  (make--comp-mvar :id (funcall (comp-func-ssa-cnt-gen comp-func))
-                   :slot slot :const-vld const-vld :constant constant
-                   :type type))
+  (let ((mvar (make--comp-mvar :slot slot
+                               :const-vld const-vld
+                               :constant constant
+                               :type type)))
+    (setf (comp-mvar-id mvar) (sxhash-eq mvar))
+    mvar))
 
 (defun comp-compute-edges ()
   "Compute the basic block edges for the current function."
@@ -1518,7 +1514,6 @@ PRE-LAMBDA and POST-LAMBDA are called in pre or 
post-order if non nil."
              (let ((comp-func f))
                ;; TODO: if this is run more than once we should clean all CFG
                ;; data including phis here.
-               (comp-func-reset-generators comp-func)
                (comp-compute-edges)
                (comp-compute-dominator-tree)
                (comp-compute-dominator-frontiers)
@@ -1571,7 +1566,6 @@ PRE-LAMBDA and POST-LAMBDA are called in pre or 
post-order if non nil."
         (copy-comp-mvar insn)
       insn)))
 
-
 (defun comp-ref-args-to-array (args)
   "Given ARGS assign them to a dedicated array."
   (when args



reply via email to

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