diff options
| author | Andrea Corallo | 2020-11-08 10:40:05 +0100 |
|---|---|---|
| committer | Andrea Corallo | 2020-11-12 00:54:46 +0100 |
| commit | c3d0e2a09fd72aa9209dda3057bbb02f6a3b3df6 (patch) | |
| tree | f18a3c9c5c5611bc9b9e2f2e4d3bc16575263703 | |
| parent | e20cdf937e74ebcaa2c6dabb63be1c20a6ea44f6 (diff) | |
| download | emacs-c3d0e2a09fd72aa9209dda3057bbb02f6a3b3df6.tar.gz emacs-c3d0e2a09fd72aa9209dda3057bbb02f6a3b3df6.zip | |
* Rename two nativecomp functions
* lisp/emacs-lisp/comp.el (comp-function-foldable-p): Rename from
comp-function-optimizable-p.
(comp-function-call-maybe-fold): Same from
comp-function-call-maybe-fold.
| -rw-r--r-- | lisp/emacs-lisp/comp.el | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 887a6a503ec..8bee8afeacf 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el | |||
| @@ -2223,12 +2223,12 @@ Forward propagate immediate involed in assignments." | |||
| 2223 | (comp-mvar-constant lval) (comp-mvar-constant rval) | 2223 | (comp-mvar-constant lval) (comp-mvar-constant rval) |
| 2224 | (comp-mvar-type lval) (comp-mvar-type rval))) | 2224 | (comp-mvar-type lval) (comp-mvar-type rval))) |
| 2225 | 2225 | ||
| 2226 | (defsubst comp-function-optimizable-p (f args) | 2226 | (defsubst comp-function-foldable-p (f args) |
| 2227 | "Given function F called with ARGS return non-nil when optimizable." | 2227 | "Given function F called with ARGS return non-nil when optimizable." |
| 2228 | (and (cl-every #'comp-mvar-const-vld args) | 2228 | (and (cl-every #'comp-mvar-const-vld args) |
| 2229 | (comp-function-pure-p f))) | 2229 | (comp-function-pure-p f))) |
| 2230 | 2230 | ||
| 2231 | (defsubst comp-function-call-maybe-remove (insn f args) | 2231 | (defsubst comp-function-call-maybe-fold (insn f args) |
| 2232 | "Given INSN when F is pure if all ARGS are known remove the function call." | 2232 | "Given INSN when F is pure if all ARGS are known remove the function call." |
| 2233 | (cl-flet ((rewrite-insn-as-setimm (insn value) | 2233 | (cl-flet ((rewrite-insn-as-setimm (insn value) |
| 2234 | ;; See `comp-emit-setimm'. | 2234 | ;; See `comp-emit-setimm'. |
| @@ -2243,7 +2243,7 @@ Forward propagate immediate involed in assignments." | |||
| 2243 | comp-symbol-values-optimizable))) | 2243 | comp-symbol-values-optimizable))) |
| 2244 | (rewrite-insn-as-setimm insn (symbol-value (comp-mvar-constant | 2244 | (rewrite-insn-as-setimm insn (symbol-value (comp-mvar-constant |
| 2245 | (car args)))))) | 2245 | (car args)))))) |
| 2246 | ((comp-function-optimizable-p f args) | 2246 | ((comp-function-foldable-p f args) |
| 2247 | (ignore-errors | 2247 | (ignore-errors |
| 2248 | ;; No point to complain here in case of error because we | 2248 | ;; No point to complain here in case of error because we |
| 2249 | ;; should do basic block pruning in order to be sure that this | 2249 | ;; should do basic block pruning in order to be sure that this |
| @@ -2265,12 +2265,12 @@ Forward propagate immediate involed in assignments." | |||
| 2265 | (`(,(or 'call 'callref) ,f . ,args) | 2265 | (`(,(or 'call 'callref) ,f . ,args) |
| 2266 | (setf (comp-mvar-type lval) | 2266 | (setf (comp-mvar-type lval) |
| 2267 | (alist-get f comp-known-ret-types)) | 2267 | (alist-get f comp-known-ret-types)) |
| 2268 | (comp-function-call-maybe-remove insn f args)) | 2268 | (comp-function-call-maybe-fold insn f args)) |
| 2269 | (`(,(or 'direct-call 'direct-callref) ,f . ,args) | 2269 | (`(,(or 'direct-call 'direct-callref) ,f . ,args) |
| 2270 | (let ((f (comp-func-name (gethash f (comp-ctxt-funcs-h comp-ctxt))))) | 2270 | (let ((f (comp-func-name (gethash f (comp-ctxt-funcs-h comp-ctxt))))) |
| 2271 | (setf (comp-mvar-type lval) | 2271 | (setf (comp-mvar-type lval) |
| 2272 | (alist-get f comp-known-ret-types)) | 2272 | (alist-get f comp-known-ret-types)) |
| 2273 | (comp-function-call-maybe-remove insn f args))) | 2273 | (comp-function-call-maybe-fold insn f args))) |
| 2274 | (_ | 2274 | (_ |
| 2275 | (comp-mvar-propagate lval rval)))) | 2275 | (comp-mvar-propagate lval rval)))) |
| 2276 | (`(assume ,lval ,rval ,kind) | 2276 | (`(assume ,lval ,rval ,kind) |