summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/comp.el
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2020-02-16 08:46:30 +0000
committerAndrea Corallo <akrl@sdf.org>2020-02-16 08:46:30 +0000
commit2a8a3a9f28a6b1404161512115b059a376bc07f0 (patch)
tree767b53eae0fa77cbe6b6c0359fb24d290298f5f6 /lisp/emacs-lisp/comp.el
parent4b4c7535a053caf8a074246d0eabb44873119076 (diff)
downloademacs-2a8a3a9f28a6b1404161512115b059a376bc07f0.tar.gz
emacs-2a8a3a9f28a6b1404161512115b059a376bc07f0.tar.bz2
emacs-2a8a3a9f28a6b1404161512115b059a376bc07f0.zip
Use `sxhash-eq' to generate mvar SSA ids
Diffstat (limited to 'lisp/emacs-lisp/comp.el')
-rw-r--r--lisp/emacs-lisp/comp.el18
1 files changed, 6 insertions, 12 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 9a782f7497f..b6c1a95315d 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