Have inlining reporting produce report entries directly.

This commit is contained in:
Vincent St-Amour 2012-11-25 17:58:11 -05:00
parent 4933d9f00f
commit 6d7f1627b8
2 changed files with 30 additions and 22 deletions

View File

@ -180,23 +180,30 @@
;; Produce as many log entries as necessary. ;; Produce as many log entries as necessary.
(define (emit e) (set! produced-entries (cons e produced-entries))) (define (emit e) (set! produced-entries (cons e produced-entries)))
(define start (sub1 pos))
(define end (+ start (syntax-span stx)))
(define (emit-near-miss msg badness) (define (emit-near-miss msg badness)
(emit (missed-opt-log-entry (emit (report-entry
kind (list (missed-opt-report-entry
(format "Missed Inlining ~a\n~a~a" located-stx
(format-aggregation-string pruned-log) (format "Missed Inlining ~a\n~a~a"
(if msg (format "~a\n" msg) "") (format-aggregation-string pruned-log)
recommendation) (if msg (format "~a\n" msg) "")
stx located-stx pos provenance recommendation)
'() '() provenance
;; uses ceiling to never go down to 0 badness
;; both badness and badness-multiplier are non-0 '())) ; no irritants to highlight
(ceiling (* badness badness-multiplier))))) start end
badness)))
(define (emit-success) (define (emit-success)
(emit (opt-log-entry (emit (report-entry
kind (list (opt-report-entry
(format "Inlining ~a" (format-aggregation-string pruned-log)) located-stx
stx located-stx pos provenance))) (format "Inlining ~a"
(format-aggregation-string pruned-log))
provenance))
start end
0)))
(define inside-hot-function? (define inside-hot-function?
(and profile (memq profile-entry hot-functions))) (and profile (memq profile-entry hot-functions)))

View File

@ -10,13 +10,14 @@
(define (generate-report this profile) (define (generate-report this profile)
(define-values (TR-log mzc-log info-log) (generate-logs this)) (define-values (TR-log mzc-log info-log) (generate-logs this))
(define hot-functions (and profile (prune-profile profile))) (define hot-functions (and profile (prune-profile profile)))
(log->report (append
(append (causality-merging (log->report
(prune-cold-TR-failures TR-log profile hot-functions)) (append (causality-merging
(report-inlining mzc-log profile hot-functions) (prune-cold-TR-failures TR-log profile hot-functions))
(if profile (if profile
(report-hidden-costs info-log profile hot-functions) (report-hidden-costs info-log profile hot-functions)
'())))) '())))
(report-inlining mzc-log profile hot-functions)))
;; Returns a report-entry or #f, which means prune. ;; Returns a report-entry or #f, which means prune.