anchor.diff:                          (push (gethash (live-range-vreg spill) registers) free-registers)))
                        (t
                         (setf (gethash (cons inst vreg) instantaneous-registers) (pop available-regs))))
  -               #+(or)
  -               (format t "Pick ~S for ~S~%" (gethash (cons inst vreg) instantaneous-registers) vreg)))))
  +               (unless *shut-up*
  +                 (format t "Pick ~S for ~S~%" (gethash (cons inst vreg) instantaneous-registers) vreg))))))
       (values registers spilled instantaneous-registers)))
   
   (defgeneric replace-all-registers (instruction substitution-function))
  
positive.code:          for instruction-index from 0
           for inst in ordering
           do
                 #+(or)
             (print-instruction inst)
             (expire-old-intervals instruction-index)
             (loop
                (when (not (and remaining-live-ranges
                                (eql instruction-index (live-range-start (first remaining-live-ranges)))))
                  (return))
                (let* ((interval (pop remaining-live-ranges))
                       (candidates (remove-if (lambda (reg)
                                                (or (member reg (live-range-conflicts interval))
                                                    ;; If the instruction is a move instruction with physical source/destinations,
                                                    ;; then conflict with it unless this interval is a source/dest and ends/begins
                                                    ;; on this instruction.
                                                    (and (typep inst 'move-instruction)
                                                         (or (and (typep (move-source inst) 'physical-register)
                                                                  (eql (move-source inst) reg)
                                                                  (not (and (eql (move-destination inst) (live-range-vreg interval))
                                                                            (eql instruction-index (live-range-start interval)))))
                                                             (and (typep (move-destination inst) 'physical-register)
                                                                  (eql (move-destination inst) reg)
                                                                  (not (and (eql (move-source inst) (live-range-vreg interval))
                                                                            (eql instruction-index (live-range-end interval)))))))))
                                              free-registers))
                       (hint (or (live-range-hint interval)
                                 (if (and (typep inst 'move-instruction)
                                          (eql (move-destination inst) (live-range-vreg interval))
                                          (typep (move-source inst) 'physical-register)
                                          (not (member (move-source inst) (live-range-conflicts interval))))
                                     (move-source inst)
                                     nil)))
                       (reg (if (member hint candidates)
                                hint
                                (first candidates))))
                 #+(or)
                  (format t "Interval ~S~%" interval)
                 #+(or)
                  (format t "Candidates ~S~%" candidates)
                 #+(or)
                  (format t "hint/reg ~S / ~S~%" hint reg)
                  (cond ((and (typep inst 'argument-setup-instruction)
                              (eql instruction-index (live-range-end interval)))
                         ;; Argument setup instruction with an unused argument.
                         ;; Just spill it.
                         (push (live-range-vreg interval) spilled))
                        ((not reg)
                         (spill-at-interval interval))
                        (t
                         (setf free-registers (remove reg free-registers))
                         (setf (gethash (live-range-vreg interval) registers) reg)
                         (setf active (merge 'list (list interval) active #'< :key 'live-range-end))))))
             ;; Now add instantaneous intervals for spilled registers.
             (let* ((vregs (union (remove-duplicates
                                   (remove-if-not (lambda (r)
  
negative.code:            (spilled-output-vregs (remove-if-not (lambda (vreg)
                                                    (member vreg spilled))
                                                  output-vregs)))
        (cond ((typep inst 'move-instruction)
               (cond ((and spilled-input-vregs spilled-output-vregs)
                      ;; Both the input & the output were spilled.
                      ;; Fill into the instant for the input, then spill directly into the output.
                      (let ((reg (or (gethash (cons inst (move-source inst)) instantaneous-registers)
                                     (gethash (move-source inst) registers)
                                     (error "Missing instantaneous register for spill ~S at ~S." (move-source inst) inst))))
                        (insert-before backend-function inst
                                       (make-instance 'fill-instruction
                                                      :destination reg
                                                      :source (move-source inst)))
                        (insert-before backend-function inst
                                       (make-instance 'spill-instruction
                                                      :destination (move-destination inst)
                                                      :source reg))
                        (remove-instruction backend-function inst)))
                     (spilled-input-vregs
                      ;; Input was spilled, fill directly into the output.
                      (let ((reg (or (gethash (move-destination inst) registers)
                                     (move-destination inst))))
                        (insert-before backend-function inst
                                       (make-instance 'fill-instruction
                                                      :destination reg
                                                      :source (move-source inst)))
                        (remove-instruction backend-function inst)))
                     (spilled-output-vregs
                      ;; Output was spilled, spill directly into the output.
                      (let ((reg (or (gethash (move-source inst) registers)
                                     (move-source inst))))
                        (insert-before backend-function inst
                                       (make-instance 'spill-instruction
                                                      :destination (move-destination inst)
                                                      :source reg))
                        (remove-instruction backend-function inst)))
                     ((eql (or (gethash (move-source inst) registers)
                               (move-source inst))
                           (or (gethash (move-destination inst) registers)
                               (move-destination inst)))
                      ;; Source & destination are the same register (not spilled), eliminate the move.
                      (remove-instruction backend-function inst))
                     (t
                      ;; Just rewrite the instruction.
                      (replace-all-registers inst
                                             (lambda (old)
                                               (let ((new (or (gethash (cons inst old) instantaneous-registers)
                                                              (gethash old registers))))
                                                 (if (or (not new)
                                                         (eql new :memory))
                                                     old
                                                     new)))))))
              (t
               ;; Load spilled input registers.
               (dolist (spill spilled-input-vregs)
                 (let ((reg (or (gethash (cons inst spill) instantaneous-registers)
                                (gethash spill registers)
                                (error "Missing instantaneous register for spill ~S at ~S." spill inst))))
                   (when (not (eql reg :memory))
                     (insert-before backend-function inst
                                    (make-instance 'fill-instruction
                                                   :destination reg
                                                   :source spill)))))
               ;; Store spilled output registers.
               (dolist (spill spilled-output-vregs)
                 (let ((reg (or (gethash (cons inst spill) instantaneous-registers)
                                (gethash spill registers)
                                (error "Missing instantaneous register for spill ~S at ~S." spill inst))))
                   (when (not (eql reg :memory))
                     (insert-after backend-function inst
                                   (make-instance 'spill-instruction
                                                  :destination spill
                                                  :source reg)))))
               ;; Rewrite the instruction.
               (replace-all-registers inst
                                      (lambda (old)
                                        (let ((new (or (gethash (cons inst old) instantaneous-registers)
                                                       (gethash old registers))))
                                          (if (or (not new)
                                                  (eql new :memory))
                                              old
                                              new)))))))))
  
  (defun build-use/def-maps (backend-function)
    (let ((uses (make-hash-table))
  