Changeset 13253


Ignore:
Timestamp:
Dec 3, 2009, 7:40:58 PM (10 years ago)
Author:
gb
Message:

Claim that certain cases of %SVREF are "side-effect free", which is
both a hack and a misnomer.
What we really want to know is whether given two expressions X and
Y, can we evaluate X to volatile register rX and Y to volatile register
rY without clobbering rX. That's true of some cases of %SVREF, but we
really want to know something more general, like "can we evaluate Y without
using rX ?", and that may be harder to answer.

When doing variable substitution in something like:

(let* ((a (foo)))

(declare (integer foo))
...
(let* ((b a))

(declare (fixnum a))
...))

if we substitute B for A, ensure that those references to B are constrained
to the type of A (FIXNUM in this case.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/X86/x862.lisp

    r13250 r13253  
    29882988    (or (x86-constant-form-p form)
    29892989        ;(eq (acode-operator form) (%nx1-operator bound-special-ref))
     2990        (and (eq (acode-operator form) (%nx1-operator %svref))
     2991             (destructuring-bind (v i) (acode-operands form)
     2992               (let* ((idx (acode-fixnum-form-p i)))
     2993                 (and idx
     2994                      (nx2-constant-index-ok-for-type-keyword idx :simple-vector)
     2995                      (consp (setq v (acode-unwrapped-form-value v)))
     2996                      (eq (acode-operator v) (%nx1-operator lexical-reference))
     2997                      (let* ((var (cadr v)))
     2998                        (unless (%ilogbitp $vbitsetq (nx-var-bits var))
     2999                          (var-nvr var)))))))
    29903000        (if (eq (acode-operator form) (%nx1-operator lexical-reference))
    29913001          (not (%ilogbitp $vbitsetq (nx-var-bits (%cadr form))))))))
     
    43744384              (progn
    43754385                (nx-set-var-bits var (%ilogior (%ilsl $vbitpunted 1) bits))
     4386                (let* ((vtype (var-inittype var)))
     4387                  (when (and vtype (not (eq t vtype)))
     4388                    (setq puntval (make-acode (%nx1-operator typed-form)
     4389                                              vtype
     4390                                              puntval
     4391                                              nil))))
    43764392                (nx2-replace-var-refs var puntval)
    43774393                (x862-set-var-ea seg var puntval))
Note: See TracChangeset for help on using the changeset viewer.