Have inlining reporting produce report entries directly.
This commit is contained in:
parent
4933d9f00f
commit
6d7f1627b8
|
@ -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
|
||||||
|
located-stx
|
||||||
(format "Missed Inlining ~a\n~a~a"
|
(format "Missed Inlining ~a\n~a~a"
|
||||||
(format-aggregation-string pruned-log)
|
(format-aggregation-string pruned-log)
|
||||||
(if msg (format "~a\n" msg) "")
|
(if msg (format "~a\n" msg) "")
|
||||||
recommendation)
|
recommendation)
|
||||||
stx located-stx pos provenance
|
provenance
|
||||||
'() '()
|
badness
|
||||||
;; uses ceiling to never go down to 0
|
'())) ; no irritants to highlight
|
||||||
;; both badness and badness-multiplier are non-0
|
start end
|
||||||
(ceiling (* badness badness-multiplier)))))
|
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)))
|
||||||
|
|
|
@ -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)))
|
||||||
|
(append
|
||||||
(log->report
|
(log->report
|
||||||
(append (causality-merging
|
(append (causality-merging
|
||||||
(prune-cold-TR-failures TR-log profile hot-functions))
|
(prune-cold-TR-failures TR-log profile hot-functions))
|
||||||
(report-inlining mzc-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.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user