From af6bc6e8e225cd5ce3bb2bdd2b64a6c362fb6d32 Mon Sep 17 00:00:00 2001 From: Eric Dobson Date: Mon, 18 Nov 2013 08:40:09 -0800 Subject: [PATCH] Make unboxed let-bindings only log their clause. --- .../typed-racket/optimizer/unboxed-let.rkt | 10 ++------- .../typed-racket/optimizer/tests/flrandom.rkt | 11 +++++----- .../optimizer/tests/invalid-unboxed-let.rkt | 2 +- .../optimizer/tests/make-polar.rkt | 2 +- .../optimizer/tests/nested-unboxed-let.rkt | 4 ++-- .../tests/unboxed-let-constants-fail1.rkt | 19 +++++++++-------- .../optimizer/tests/unboxed-let-constants.rkt | 15 ++++++------- .../optimizer/tests/unboxed-let.rkt | 6 +++--- .../optimizer/tests/unboxed-let2.rkt | 21 ++++++++++--------- .../optimizer/tests/unboxed-let3.rkt | 2 +- .../tests/unboxed-letrec-syntaxes+values.rkt | 2 +- .../optimizer/tests/unboxed-letrec.rkt | 17 ++++++++------- .../tests/unboxed-make-rectangular.rkt | 4 ++-- 13 files changed, 56 insertions(+), 59 deletions(-) diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/optimizer/unboxed-let.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/optimizer/unboxed-let.rkt index f32821025c..924c36711c 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/optimizer/unboxed-let.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/optimizer/unboxed-let.rkt @@ -65,40 +65,34 @@ _:unboxed-fun-definition))) (define-syntax-class unboxed-clause? - #:attributes (unboxed-let bindings) + #:attributes (bindings) (pattern v:unboxed-let-clause? - #:attr unboxed-let #t #:with (real-binding imag-binding) (binding-names) #:do [(add-unboxed-var! #'v.id #'real-binding #'imag-binding)] #:attr bindings (delay (syntax-parse #'v [((id:id) c:unboxed-float-complex-opt-expr) + #:do [(log-opt "unboxed let bindings" arity-raising-opt-msg)] #'(c.bindings ... ((real-binding) c.real-binding) ((imag-binding) c.imag-binding))]))) (pattern v:unboxed-fun-clause? - #:attr unboxed-let #f #:attr bindings (delay (syntax-parse #'v [c:unboxed-fun-clause #'(c.bindings ...)]))) (pattern v - #:attr unboxed-let #f #:attr bindings (delay (syntax-parse #'v [(vs rhs:opt-expr) #'((vs rhs.opt))])))) - (define full-syntax this-syntax) (define-syntax-class unboxed-clauses #:attributes ([bindings 1]) (pattern (clauses:unboxed-clause? ...) - ;; only log when we actually optimize - #:do [(when (member #t (attribute clauses.unboxed-let)) - (log-optimization "unboxed let bindings" arity-raising-opt-msg full-syntax))] #:with (bindings ...) (template ((?@ . clauses.bindings) ...))))] #:with opt diff --git a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/optimizer/tests/flrandom.rkt b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/optimizer/tests/flrandom.rkt index c077fa6745..0e76a32dfd 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/optimizer/tests/flrandom.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/optimizer/tests/flrandom.rkt @@ -1,13 +1,12 @@ #;#; #<