Make data keep track of their last use
This commit is contained in:
parent
c1846e35bd
commit
b7c4a37483
2 changed files with 9 additions and 1 deletions
|
@ -1,7 +1,8 @@
|
|||
(in-package #:user-side-compiler)
|
||||
|
||||
(defclass ir-data ()
|
||||
((%definition :accessor definition :initarg :definition)))
|
||||
((%definition :accessor definition :initarg :definition)
|
||||
(%last-use :accessor last-use)))
|
||||
|
||||
(defclass ir-result (ir-data)
|
||||
((%user :accessor user :initarg :user :initform nil)))
|
||||
|
|
|
@ -168,3 +168,10 @@ though I'm pretty sure it can't anyway.")
|
|||
(push input arguments))))
|
||||
(loop :for (new . old) :in replacements
|
||||
:do (setf (inputs call) (substitute new old (inputs call)))))))))
|
||||
|
||||
(defun compute-lifetime-knowledge (start-iblock)
|
||||
(do-iblocks (iblock start-iblock)
|
||||
(do-instructions (inst iblock)
|
||||
(loop :for data :in (inputs inst)
|
||||
:when (typep data 'ir-data)
|
||||
:do (setf (last-use data) inst)))))
|
||||
|
|
Loading…
Add table
Reference in a new issue