Make value allocator aware of normal values used in branching
This way we avoid allocating and using a temporary variable when branching based on the contents of a variable.
This commit is contained in:
parent
b1b7d863b5
commit
9685f00e10
1 changed files with 5 additions and 5 deletions
|
@ -6,7 +6,7 @@
|
|||
;;; allocator instead.
|
||||
|
||||
(defparameter +accumulator-users+
|
||||
'(or ir-operation ir-assign))
|
||||
'(or ir-operation ir-assign ir-if))
|
||||
|
||||
(defun calls-exist-between-p (start end)
|
||||
(labels
|
||||
|
@ -50,14 +50,14 @@
|
|||
:not-saved)
|
||||
((typep data 'ir-variable)
|
||||
:named-variable)
|
||||
((and (eql (next (definition data)) (last-use data))
|
||||
(typep (last-use data) +accumulator-users+)
|
||||
(eql data (first (inputs (last-use data)))))
|
||||
:accumulator)
|
||||
((and (eql (next (definition data)) (last-use data))
|
||||
(typep (last-use data) 'ir-if)
|
||||
(typep (definition data) 'ir-comparison))
|
||||
:branch)
|
||||
((and (eql (next (definition data)) (last-use data))
|
||||
(typep (last-use data) +accumulator-users+)
|
||||
(eql data (first (inputs (last-use data)))))
|
||||
:accumulator)
|
||||
((and (= (length (users data)) 1)
|
||||
(typep (last-use data) 'ir-call)
|
||||
(not (calls-exist-between-p (definition data) (last-use data))))
|
||||
|
|
Loading…
Add table
Reference in a new issue