Remove buggy `substitute' uses
authorDavid Vázquez <davazp@gmail.com>
Sat, 1 Jun 2013 11:55:35 +0000 (12:55 +0100)
committerDavid Vázquez <davazp@gmail.com>
Sat, 1 Jun 2013 11:55:35 +0000 (12:55 +0100)
experimental/compiler.lisp

index 6f6de91..6b11e1b 100644 (file)
     (setf (block-pred block) nil)
     (dolist (pred predecessors)
       (pushnew pred (block-pred new-block))
-      (setf (block-succ pred) (substitute new-block block (block-succ pred)))
+      (setf (block-succ pred) (remove block (block-succ pred)))
+      (pushnew new-block (block-succ pred))
       (unless (component-entry-p pred)
         (let ((last-node (node-prev (block-exit pred))))
           (when (conditional-p last-node)
         (setf (block-exit block) (block-exit succ))
         (setf (block-succ block) (block-succ succ))
         (dolist (next (block-succ succ))
-          (setf (block-pred next) (substitute block succ (block-pred next))))
+          (setf (block-pred next) (remove succ (block-pred next)))
+          (pushnew block (block-pred next)))
         (setf (block-succ succ) nil
               (block-pred succ) nil)
         t))))
                    (dolist (pred (cdr predecessors) newblocks)
                      (let ((newblock (copy-basic-block block)))
                        (setf (block-pred newblock) (list pred))
-                       (setf (block-succ pred) (substitute newblock block (block-succ pred)))
+                       (setf (block-succ pred) (remove block (block-succ pred)))
+                       (pushnew newblock (block-succ pred))
                        (push newblock newblocks))))))))
       ;; Reduce component using the transformations T1 and T2 as much
       ;; as possible. Then apply the node splitting transformation (S)