TR for clause specialization: Report specialization failures.

original commit: d6372ef2dced88bba56d640b03158f1652671be5
This commit is contained in:
Vincent St-Amour 2013-10-10 13:15:05 -04:00
parent 5b36f34fe4
commit 82d0c4a3b8
3 changed files with 41 additions and 20 deletions

View File

@ -91,4 +91,10 @@
0
(lambda (x) (unsafe-fx< x end))
(lambda (x) #t)
(lambda (x y) #t)))))
(lambda (x y) #t))))
(pattern (#%plain-app op:make-sequence arg:opt-expr s:opt-expr)
#:do [(log-missed-optimization
"non-specialized for clause"
"Typed Racket failed to specialize this `for' clause, which introduces run-time dispatch overhead. You can avoid this by limiting the sequence's type to a single kind of sequence (e.g. lists, vectors, or integers) or specializing the sequence manually (e.g. by wrapping it in an `in-list', `in-vector' or `in-range')."
#'s)]
#:with opt #'(op arg.opt s.opt)))

View File

@ -1,24 +1,28 @@
#;#;
#<<END
TR info: marketplace-struct.rkt 113:39 process -- struct constructor
TR info: marketplace-struct.rkt 120:3 vm -- struct constructor
TR info: marketplace-struct.rkt 62:9 vm -- struct constructor
TR info: marketplace-struct.rkt 62:9 vm -- struct constructor
TR opt: marketplace-struct.rkt 127:2 (struct-copy vm state (processes (hash-set (vm-processes state) (Process-pid wp) wp))) -- dead else branch
TR opt: marketplace-struct.rkt 127:2 (struct-copy vm state (processes (hash-set (vm-processes state) (Process-pid wp) wp))) -- struct ref
TR opt: marketplace-struct.rkt 127:45 (vm-processes state) -- struct ref
TR opt: marketplace-struct.rkt 134:23 (vm-processes state) -- struct ref
TR opt: marketplace-struct.rkt 135:10 (if wp (struct-copy vm state (processes (hash-remove (vm-processes state) pid))) state) -- dead else branch
TR opt: marketplace-struct.rkt 135:10 (if wp (struct-copy vm state (processes (hash-remove (vm-processes state) pid))) state) -- struct ref
TR opt: marketplace-struct.rkt 136:60 (vm-processes state) -- struct ref
TR opt: marketplace-struct.rkt 142:48 (vm-processes state) -- struct ref
TR opt: marketplace-struct.rkt 151:46 (vm-processes state) -- struct ref
TR opt: marketplace-struct.rkt 156:60 (process-endpoints p) -- struct ref
TR opt: marketplace-struct.rkt 156:60 (process-endpoints p) -- struct ref
TR opt: marketplace-struct.rkt 157:35 (process-endpoints p) -- struct ref
TR opt: marketplace-struct.rkt 157:35 (process-endpoints p) -- struct ref
TR opt: marketplace-struct.rkt 157:35 (process-endpoints p) -- struct ref
TR opt: marketplace-struct.rkt 157:35 (process-endpoints p) -- struct ref
TR info: marketplace-struct.rkt 117:39 process -- struct constructor
TR info: marketplace-struct.rkt 124:3 vm -- struct constructor
TR info: marketplace-struct.rkt 66:9 vm -- struct constructor
TR info: marketplace-struct.rkt 66:9 vm -- struct constructor
TR missed opt: marketplace-struct.rkt 146:34 (in-hash-keys (vm-processes state)) -- non-specialized for clause
TR missed opt: marketplace-struct.rkt 155:32 (in-hash-keys (vm-processes state)) -- non-specialized for clause
TR missed opt: marketplace-struct.rkt 160:46 (in-hash-keys (process-endpoints p)) -- non-specialized for clause
TR missed opt: marketplace-struct.rkt 160:46 (in-hash-keys (process-endpoints p)) -- non-specialized for clause
TR opt: marketplace-struct.rkt 131:2 (struct-copy vm state (processes (hash-set (vm-processes state) (Process-pid wp) wp))) -- dead else branch
TR opt: marketplace-struct.rkt 131:2 (struct-copy vm state (processes (hash-set (vm-processes state) (Process-pid wp) wp))) -- struct ref
TR opt: marketplace-struct.rkt 131:45 (vm-processes state) -- struct ref
TR opt: marketplace-struct.rkt 138:23 (vm-processes state) -- struct ref
TR opt: marketplace-struct.rkt 139:10 (if wp (struct-copy vm state (processes (hash-remove (vm-processes state) pid))) state) -- dead else branch
TR opt: marketplace-struct.rkt 139:10 (if wp (struct-copy vm state (processes (hash-remove (vm-processes state) pid))) state) -- struct ref
TR opt: marketplace-struct.rkt 140:60 (vm-processes state) -- struct ref
TR opt: marketplace-struct.rkt 146:48 (vm-processes state) -- struct ref
TR opt: marketplace-struct.rkt 155:46 (vm-processes state) -- struct ref
TR opt: marketplace-struct.rkt 160:60 (process-endpoints p) -- struct ref
TR opt: marketplace-struct.rkt 160:60 (process-endpoints p) -- struct ref
TR opt: marketplace-struct.rkt 161:35 (process-endpoints p) -- struct ref
TR opt: marketplace-struct.rkt 161:35 (process-endpoints p) -- struct ref
TR opt: marketplace-struct.rkt 161:35 (process-endpoints p) -- struct ref
TR opt: marketplace-struct.rkt 161:35 (process-endpoints p) -- struct ref
END
""
#lang typed/racket/base

View File

@ -0,0 +1,11 @@
#;#;
#<<END
TR missed opt: sequence.rkt 10:22 s -- non-specialized for clause
END
""
#lang typed/racket/base
(: seq-generic : (Sequenceof Integer) -> Void)
(define (seq-generic s)
(for: ([x : Integer s])
(void)))