Move register allocation to its own package, SB!REGALLOC
authorPaul Khuong <pvk@pvk.ca>
Tue, 12 Nov 2013 23:31:59 +0000 (18:31 -0500)
committerPaul Khuong <pvk@pvk.ca>
Mon, 2 Dec 2013 03:44:43 +0000 (22:44 -0500)
package-data-list.lisp-expr
src/compiler/main.lisp
src/compiler/pack.lisp
src/compiler/vmdef.lisp

index 5730ea0..bf946c1 100644 (file)
@@ -2203,6 +2203,68 @@ ISBN 0-262-61074-4, with exceptions as noted in the User Manual."
                "WRITER-METHOD-CLASS"))
 
    #s(sb-cold:package-data
+      :name "SB!REGALLOC"
+      :doc "private: implementation of the compiler's register allocator"
+      :use ("CL" "SB!ALIEN-INTERNALS" "SB!ALIEN" "SB!ASSEM" "SB!BIGNUM"
+                 #!+sb-dyncount "SB-DYNCOUNT" "SB!EXT" "SB!FASL" "SB!INT"
+                 "SB!KERNEL" "SB!SYS"
+                 "SB!C")
+      :import-from (("SB!C"
+                     "*LOOP-ANALYZE*"
+                     "BLOCK-INFO" "BLOCK-LAST" "BLOCK-LOOP" "BLOCK-NEXT"
+                     "CLEAR-BIT-VECTOR" "COMPONENT-HEAD" "COMPONENT-TAIL"
+                     "DEFEVENT" "DELETE-VOP" "DO-IR2-BLOCKS" "DO-LIVE-TNS"
+                     "EMIT-LOAD-TEMPLATE" "EVENT" "FIND-IN"
+                     "FINITE-SB" "FINITE-SB-ALWAYS-LIVE"
+                     "FINITE-SB-ALWAYS-LIVE-COUNT" "FINITE-SB-CONFLICTS"
+                     "FINITE-SB-CURRENT-SIZE" "FINITE-SB-LAST-BLOCK-COUNT"
+                     "FINITE-SB-LAST-OFFSET" "FINITE-SB-LIVE-TNS"
+                     "FINITE-SB-SIZE-ALIGNMENT" "FINITE-SB-SIZE-INCREMENT"
+                     "GET-OPERAND-INFO" "GLOBAL-CONFLICTS-BLOCK"
+                     "GLOBAL-CONFLICTS-CONFLICTS" "GLOBAL-CONFLICTS-KIND"
+                     "GLOBAL-CONFLICTS-NEXT-TNWISE" "GLOBAL-CONFLICTS-NUMBER"
+                     "GLOBAL-CONFLICTS-NEXT-BLOCKWISE" "GLOBAL-CONFLICTS-TN"
+                     "IR2-BLOCK" "IR2-BLOCK-COUNT" "IR2-BLOCK-GLOBAL-TNS"
+                     "IR2-BLOCK-LAST-VOP" "IR2-BLOCK-LIVE-IN"
+                     "IR2-BLOCK-LOCAL-TN-COUNT" "IR2-BLOCK-LOCAL-TNS"
+                     "IR2-BLOCK-NEXT" "IR2-BLOCK-NUMBER" "IR2-BLOCK-PREV"
+                     "IR2-BLOCK-START-VOP" "IR2-COMPONENT"
+                     "IR2-COMPONENT-GLOBAL-TN-COUNTER"
+                     "IR2-COMPONENT-NORMAL-TNS" "IR2-COMPONENT-RESTRICTED-TNS"
+                     "IR2-COMPONENT-SPILLED-TNS" "IR2-COMPONENT-SPILLED-VOPS"
+                     "IR2-COMPONENT-WIRED-TNS"
+                     "LAMBDA-PARENT" "LEXENV-LAMBDA" "LISTIFY-RESTRICTIONS"
+                     "LOCAL-TN-BIT-VECTOR" "LOCAL-TN-COUNT" "LOCAL-TN-LIMIT"
+                     "LOCAL-TN-NUMBER" "LOCAL-TN-VECTOR"
+                     "LOOP-DEPTH" "MAKE-TN" "MOVE-OPERAND" "NODE" "NODE-LEXENV"
+                     "OPERAND-PARSE-NAME" "POSITION-IN"
+                     "PRIMITIVE-TYPE-SCS" "PRINT-TN-GUTS"
+                     "SB-KIND" "SB-SIZE"
+                     "SC-ALIGNMENT" "SC-ALLOWED-BY-PRIMITIVE-TYPE"
+                     "SC-ALTERNATE-SCS" "SC-CONSTANT-SCS" "SC-ELEMENT-SIZE"
+                     "SC-LOCATIONS" "SC-MOVE-FUNS" "SC-RESERVE-LOCATIONS"
+                     "SC-SAVE-P" "SC-VECTOR"
+                     "SET-BIT-VECTOR"
+                     "SSET" "SSET-ELEMENT" "SSET-ADJOIN" "SSET-DELETE"
+                     "SSET-MEMBER" "SSET-EMPTY" "COPY-SSET"
+                     "TEMPLATE-NAME"
+                     "TN" "TN-COST" "TN-GLOBAL-CONFLICTS" "TN-KIND" "TN-LEAF"
+                     "TN-LOCAL" "TN-LOCAL-CONFLICTS" "TN-LOCAL-NUMBER"
+                     "TN-LOOP-DEPTH" "TN-NEXT" "TN-NUMBER" "TN-PRIMITIVE-TYPE"
+                     "TN-READS" "TN-SAVE-TN" "TN-WRITES"
+                     "TNS-CONFLICT" "TNS-CONFLICT-GLOBAL-GLOBAL"
+                     "TNS-CONFLICT-LOCAL-GLOBAL"
+                     "VOP" "VOP-ARGS" "VOP-INFO" "VOP-INFO-ARG-LOAD-SCS"
+                     "VOP-INFO-MOVE-ARGS" "VOP-INFO-NAME"
+                     "VOP-INFO-RESULT-LOAD-SCS" "VOP-INFO-SAVE-P"
+                     "VOP-INFO-TARGET-FUN" "VOP-NEXT" "VOP-NODE"
+                     "VOP-PARSE-OR-LOSE" "VOP-PARSE-TEMPS" "VOP-PREV"
+                     "VOP-REFS" "VOP-RESULTS" "VOP-SAVE-SET" "VOP-TEMPS"))
+      :export ("PACK" "TARGET-IF-DESIRABLE"
+               "*PACK-ASSIGN-COSTS*" "*PACK-OPTIMIZE-SAVES*"
+               "*TN-WRITE-COSTS*"))
+
+   #s(sb-cold:package-data
       :name "SB!PCL"
       :doc
       "semi-public: This package includes useful meta-object protocol
index 4463996..7ca4376 100644 (file)
@@ -595,7 +595,7 @@ necessary, since type inference may take arbitrarily long to converge.")
             (check-life-consistency component))
 
           (maybe-mumble "pack ")
-          (pack component)
+          (sb!regalloc:pack component)
 
           (when *check-consistency*
             (maybe-mumble "check-pack ")
index 3c15c50..334f212 100644 (file)
@@ -11,7 +11,7 @@
 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
 ;;;; files for more information.
 
-(in-package "SB!C")
+(in-package "SB!REGALLOC")
 
 ;;; for debugging: some parameters controlling which optimizations we
 ;;; attempt
index adf60b6..c3f3d44 100644 (file)
              (when targets
                (dotimes (i (length targets))
                  (let ((target (aref targets i)))
-                   (target-if-desirable
+                   (sb!regalloc:target-if-desirable
                     (aref refs (ldb (byte 8 8) target))
                     (aref refs (ldb (byte 8 0) target)))))))
            vop)