From ae5ce96ee3dd78dfbd3095b040e9c67578fadcb1 Mon Sep 17 00:00:00 2001 From: shubhamkar Date: Sun, 12 Nov 2023 03:03:53 +0530 Subject: [PATCH] Remove unnecessary PRINT in INLINE-APPLICATIONS --- src/codegen/optimizer.lisp | 66 ++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 34 deletions(-) diff --git a/src/codegen/optimizer.lisp b/src/codegen/optimizer.lisp index 20831024f..1a5ef3e0d 100644 --- a/src/codegen/optimizer.lisp +++ b/src/codegen/optimizer.lisp @@ -366,40 +366,38 @@ (inline-p (and (node-abstraction-p code) (tc:function-env-entry-inline-p (tc:lookup-function env name))))) - (print code) - (print - (cond ((null rands) - (make-node-variable - :type (node-type node) - :value name)) - ((and code inline-p) - (multiple-value-bind (bindings subs) - (loop :for var :in (node-abstraction-vars code) - :for val :in rands - :for new-var := (gentemp (symbol-name var)) - :collect (cons new-var val) :into bindings - :collect (make-ast-substitution - :from var - :to (make-node-variable - :type (node-type val) - :value new-var)) - :into subs - :finally (return (values bindings subs))) - (make-node-let - :type (node-type node) - :bindings bindings - :subexpr (apply-ast-substitution - subs - (node-abstraction-subexpr code))))) - (t - (make-node-application - :type (node-type node) - :rator (make-node-variable - :type (tc:make-function-type* - (mapcar #'node-type rands) - (node-type node)) - :value name) - :rands rands))))))))) + (cond ((null rands) + (make-node-variable + :type (node-type node) + :value name)) + ((and code inline-p) + (multiple-value-bind (bindings subs) + (loop :for var :in (node-abstraction-vars code) + :for val :in rands + :for new-var := (gentemp (symbol-name var)) + :collect (cons new-var val) :into bindings + :collect (make-ast-substitution + :from var + :to (make-node-variable + :type (node-type val) + :value new-var)) + :into subs + :finally (return (values bindings subs))) + (make-node-let + :type (node-type node) + :bindings bindings + :subexpr (apply-ast-substitution + subs + (node-abstraction-subexpr code))))) + (t + (make-node-application + :type (node-type node) + :rator (make-node-variable + :type (tc:make-function-type* + (mapcar #'node-type rands) + (node-type node)) + :value name) + :rands rands)))))))) (traverse node