summaryrefslogtreecommitdiffstats
path: root/stdlib/compiler.tl
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-11-02 06:56:34 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-11-02 06:56:34 -0700
commit1e11f341609e614c0268c792658c95063a92ac75 (patch)
tree381fe4807d041c412043f30553a59e5f1e8d042b /stdlib/compiler.tl
parent6fe5ed2648e3a9014a03997ca617595f2a78e9b0 (diff)
downloadtxr-1e11f341609e614c0268c792658c95063a92ac75.tar.gz
txr-1e11f341609e614c0268c792658c95063a92ac75.tar.bz2
txr-1e11f341609e614c0268c792658c95063a92ac75.zip
compiler: remove excess call to reduce-constant.
* stdlib/compiler.tl (compiler comp-arith-form): There is no need here to pass the form through reduce-constant, since we are about to divide up its arguments and individualy reduce them, much like what that function does.
Diffstat (limited to 'stdlib/compiler.tl')
-rw-r--r--stdlib/compiler.tl21
1 files changed, 10 insertions, 11 deletions
diff --git a/stdlib/compiler.tl b/stdlib/compiler.tl
index 7fea5dcd..ae64266b 100644
--- a/stdlib/compiler.tl
+++ b/stdlib/compiler.tl
@@ -1248,17 +1248,16 @@
(defmeth compiler comp-arith-form (me oreg env form)
(if (plusp *opt-level*)
- (let ((rform (reduce-constant env form)))
- (tree-case rform
- ((op . args)
- (let* ((pargs [partition-by constantp args])
- (fargs (append-each ((pa pargs))
- (if (and (constantp (car pa))
- (all pa [chain eval integerp]))
- (list (eval ^(,op ,*pa)))
- pa))))
- me.(comp-fun-form oreg env ^(,op ,*fargs))))
- (else me.(compile oreg env rform))))
+ (tree-case form
+ ((op . args)
+ (let* ((pargs [partition-by constantp args])
+ (fargs (append-each ((pa pargs))
+ (if (and (constantp (car pa))
+ (all pa [chain eval integerp]))
+ (list (eval ^(,op ,*pa)))
+ pa))))
+ me.(comp-fun-form oreg env ^(,op ,*fargs))))
+ (else me.(compile oreg env form)))
me.(comp-fun-form oreg env form)))
(defmeth compiler comp-arith-neg-form (me oreg env form)