Log hidden prng parameter dereferences.
This commit is contained in:
parent
0dcceccfa4
commit
04eeeb13f1
|
@ -11,6 +11,8 @@
|
||||||
;; not an exhaustive list
|
;; not an exhaustive list
|
||||||
(define-literal-syntax-class hidden-port-parameter-function
|
(define-literal-syntax-class hidden-port-parameter-function
|
||||||
(display displayln newline write write-byte print printf))
|
(display displayln newline write write-byte print printf))
|
||||||
|
(define-literal-syntax-class hidden-random-parameter-function
|
||||||
|
(random))
|
||||||
|
|
||||||
;; This syntax class does not perform optimization.
|
;; This syntax class does not perform optimization.
|
||||||
;; It only logs operations with hidden costs, for use by Optimization Coach.
|
;; It only logs operations with hidden costs, for use by Optimization Coach.
|
||||||
|
@ -27,6 +29,12 @@
|
||||||
(not (subtypeof? arg -Output-Port)))
|
(not (subtypeof? arg -Output-Port)))
|
||||||
#:do [(log-optimization-info "hidden parameter" #'op)]
|
#:do [(log-optimization-info "hidden parameter" #'op)]
|
||||||
#:with opt #'(op args.opt ...))
|
#:with opt #'(op args.opt ...))
|
||||||
|
(pattern (#%plain-app op:hidden-random-parameter-function args:opt-expr ...)
|
||||||
|
;; see above
|
||||||
|
#:when (for/and ([arg (in-syntax #'(args ...))])
|
||||||
|
(not (subtypeof? arg -Pseudo-Random-Generator)))
|
||||||
|
#:do [(log-optimization-info "hidden parameter (random)" #'op)]
|
||||||
|
#:with opt #'(op args.opt ...))
|
||||||
;; Log calls to struct constructors, so that OC can report those used in
|
;; Log calls to struct constructors, so that OC can report those used in
|
||||||
;; hot loops.
|
;; hot loops.
|
||||||
;; Note: Sometimes constructors are wrapped in `#%expression', need to watch
|
;; Note: Sometimes constructors are wrapped in `#%expression', need to watch
|
||||||
|
|
Loading…
Reference in New Issue
Block a user