diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-11-02 06:56:34 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-11-02 06:56:34 -0700 |
commit | 1e11f341609e614c0268c792658c95063a92ac75 (patch) | |
tree | 381fe4807d041c412043f30553a59e5f1e8d042b /stdlib/compiler.tl | |
parent | 6fe5ed2648e3a9014a03997ca617595f2a78e9b0 (diff) | |
download | txr-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.tl | 21 |
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) |