Log uses of float vectors.

For OC to recommend using flvectors instead.
This commit is contained in:
Vincent St-Amour 2015-10-13 14:57:20 -05:00
parent 6ccb0939f8
commit 6245807b7c
2 changed files with 13 additions and 2 deletions

View File

@ -4,7 +4,7 @@
(for-template racket/base)
"../utils/utils.rkt"
(optimizer utils logging)
(types abbrev struct-table))
(types abbrev numeric-tower struct-table))
(provide hidden-cost-log-expr)
@ -64,4 +64,12 @@
#:when (not (or (subtypeof? #'pattern-arg -Regexp)
(subtypeof? #'pattern-arg -Byte-Regexp)))
#:do [(log-optimization-info "non-regexp pattern" #'pattern-arg)]
#:with opt (syntax/loc this-syntax (op pattern-arg.opt args.opt ...))))
#:with opt (syntax/loc this-syntax (op pattern-arg.opt args.opt ...)))
;; vectors of floats can be replaced with flvectors in most cases
;; need to deconstruct to not infinite loop
(pattern (#%plain-app es ...)
#:when (subtypeof? this-syntax (-vec -Flonum))
#:with (es*:opt-expr ...) #'(es ...)
#:do [(log-optimization-info "vector of floats" this-syntax)]
#:with opt (syntax/loc this-syntax (es*.opt ...))))

View File

@ -0,0 +1,3 @@
#lang typed/racket
(vector 3.2 3.4)