Changeset 16623


Ignore:
Timestamp:
Oct 15, 2015, 5:47:44 PM (6 years ago)
Author:
gb
Message:

vreg.lisp: in MATCH-VREG, just use PUSH (not PUSHNEW) to
add a vinsn to an lreg's refs/defs sets.
vinsn.lisp: fix indentation in CREATE-FLOW graph. Bail out
early on very large functions, which are likely to have very
large flow graphs.

Location:
trunk/source/compiler
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/vinsn.lisp

    r16607 r16623  
    880880  (show-vinsns vinsns 2)
    881881  (let* ((nodes ()))
     882   
    882883    (flet ((label->fgn (label) (dll-node-pred label)))
    883884      (loop
     
    927928
    928929          (unless (typep first 'callnode)
    929           (dolist (ref (fgn-inedges first))
    930             (nsubstitute second first (fgn-outedges ref))
    931             (when (typep ref 'jumpnode)
    932               (when (eq first (jumpnode-outedge ref))
    933                 (setf (jumpnode-outedge ref) second))
    934               (when (typep ref 'condnode)
    935                 (when (eq first (condnode-branchedge ref))
    936                   (setf (condnode-branchedge ref) second)))))
    937 
    938           (if (setf (fgn-extended-pred second) (fgn-extended-pred first))
    939             (setf (fgn-extended-succ (fgn-extended-pred first)) second))
    940           (setf (fgn-inedges second) (fgn-inedges first))
    941           (multiple-value-bind (label1 jump) (detach-dll-nodes first)
    942             (let* ((label2 (dll-header-succ second)))
    943               (insert-dll-node-before label1 label2 jump)
    944               (when (null (delete jump (vinsn-label-refs label2)))
    945                 (remove-dll-node label2))
    946               (remove-dll-node jump)
    947               (setf (fgn-id second) (fgn-id first))))
     930            (dolist (ref (fgn-inedges first))
     931              (nsubstitute second first (fgn-outedges ref))
     932              (when (typep ref 'jumpnode)
     933                (when (eq first (jumpnode-outedge ref))
     934                  (setf (jumpnode-outedge ref) second))
     935                (when (typep ref 'condnode)
     936                  (when (eq first (condnode-branchedge ref))
     937                    (setf (condnode-branchedge ref) second)))))
     938
     939            (if (setf (fgn-extended-pred second) (fgn-extended-pred first))
     940              (setf (fgn-extended-succ (fgn-extended-pred first)) second))
     941            (setf (fgn-inedges second) (fgn-inedges first))
     942            (multiple-value-bind (label1 jump) (detach-dll-nodes first)
     943              (let* ((label2 (dll-header-succ second)))
     944                (insert-dll-node-before label1 label2 jump)
     945                (when (null (delete jump (vinsn-label-refs label2)))
     946                  (remove-dll-node label2))
     947                (remove-dll-node jump)
     948                (setf (fgn-id second) (fgn-id first))))
    948949         
    949           (setf (car nodes1) nil))))
    950 
    951        
     950            (setf (car nodes1) nil))))
     951
     952
    952953
    953954     
     
    18941895
    18951896
     1897
    18961898(defun optimize-vinsns (header)
     1899
     1900 
    18971901  ;; Delete unreferenced labels that the compiler might have emitted.
    1898 
    18991902  ;; Subsequent operations may cause other labels to become
    19001903  ;; unreferenced.
     
    19091912    (eliminate-dead-code header)
    19101913    (cond (*backend-use-linear-scan*
     1914           (let* ((size (dll-header-length header)))
     1915             (when (> size 10000)
     1916               (linear-scan-bailout "function size exceeds compiler limitation"))
     1917             )
    19111918           (normalize-vinsns header)
    19121919           (let* ((fg (create-flow-graph header))
  • trunk/source/compiler/vreg.lisp

    r16559 r16623  
    214214              (unless (or (vinsn-attribute-p vinsn :spill) (vinsn-attribute-p vinsn :reload))
    215215                (if result-p
    216                   (pushnew vinsn (lreg-defs vreg))
    217                   (pushnew vinsn (lreg-refs vreg))))
     216                  (push vinsn (lreg-defs vreg))
     217                  (push vinsn (lreg-refs vreg))))
    218218              (error "Bad vreg: ~s" vreg)))
    219219          (when vreg-value
Note: See TracChangeset for help on using the changeset viewer.