Skip to content
Snippets Groups Projects
Commit 7bd9e0e8 authored by wlott's avatar wlott
Browse files

Added stuff to also to record the number of bytes attributed to each vop

in each basic block.
parent e49636e6
No related branches found
No related tags found
No related merge requests found
...@@ -39,15 +39,42 @@ ...@@ -39,15 +39,42 @@
(let* ((info (ir2-component-dyncount-info (component-info component))) (let* ((info (ir2-component-dyncount-info (component-info component)))
(vops (dyncount-info-vops info))) (vops (dyncount-info-vops info)))
(do-ir2-blocks (block component) (do-ir2-blocks (block component)
(when (ir2-block-start-vop block) (let* ((start-vop (ir2-block-start-vop block))
(let* ((1block (ir2-block-block block)) (1block (ir2-block-block block))
(index (1- (block-number 1block))) (block-number (block-number 1block)))
(counts (svref vops index))) (when (and start-vop block-number)
(do ((vop (ir2-block-start-vop block) (vop-next vop))) (let* ((index (1- block-number))
((null vop)) (counts (svref vops index))
(let* ((vop-name (vop-info-name (vop-info vop))) (length (length counts)))
(entry (assoc vop-name counts :test #'eq))) (do ((vop start-vop (vop-next vop)))
(if entry ((null vop))
(incf (cdr entry)) (let ((vop-name (vop-info-name (vop-info vop))))
(setf counts (acons vop-name 1 counts))))) (do ((i 0 (+ i 4)))
(setf (svref vops index) counts)))))) ((or (>= i length) (eq (svref counts i) vop-name))
(when (>= i length)
(incf length 4)
(let ((new-counts
(make-array length :initial-element 0)))
(when counts
(replace new-counts counts))
(setf counts new-counts))
(setf (svref counts i) vop-name))
(incf (svref counts (1+ i)))))))
(setf (svref vops index) counts)))))
(count-instructions
#'(lambda (vop bytes elsewherep)
(let ((block-number (block-number (ir2-block-block (vop-block vop)))))
(when block-number
(let* ((name (vop-info-name (vop-info vop)))
(counts (svref vops (1- block-number)))
(length (length counts)))
(do ((i 0 (+ i 4)))
((>= i length)
(error "VOP ~S didn't exist earlier!~% counts=~S"
name counts))
(when (eq (svref counts i) name)
(incf (svref counts (+ i (if elsewherep 3 2))) bytes)
(return)))))))
*code-segment*
*elsewhere*)
(undefined-value)))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment