Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/MLRISC/ra/mem-ra.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/ra/mem-ra.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 733, Fri Nov 17 05:13:45 2000 UTC revision 1009, Wed Jan 9 19:44:22 2002 UTC
# Line 38  Line 38 
38      | isMemLoc(SPILL_LOC _) = true      | isMemLoc(SPILL_LOC _) = true
39      | isMemLoc(MEMREG _) = true      | isMemLoc(MEMREG _) = true
40      | isMemLoc _ = false      | isMemLoc _ = false
41    
42    (*    (*
43     * Spill coalescing.     * Spill coalescing.
44     * Coalesce non-interfering moves between spilled nodes,     * Coalesce non-interfering moves between spilled nodes,
# Line 136  Line 137 
137    fun spillPropagation(G as GRAPH{bitMatrix, memRegs, ...}) nodesToSpill =    fun spillPropagation(G as GRAPH{bitMatrix, memRegs, ...}) nodesToSpill =
138    let val spillCoalescing = spillCoalescing G    let val spillCoalescing = spillCoalescing G
139        exception SpillProp        exception SpillProp
140        val visited =        val visited = IntHashTable.mkTable(32, SpillProp)
141            IntHashTable.mkTable(32, SpillProp) : bool IntHashTable.hash_table                       : bool IntHashTable.hash_table
142        fun hasBeenVisited i = getOpt (IntHashTable.find visited i, false)        val hasBeenVisited = IntHashTable.find visited
143          val hasBeenVisited = fn r => case hasBeenVisited r of NONE => false
144                                                              | SOME _ => true
145        val markAsVisited = IntHashTable.insert visited        val markAsVisited = IntHashTable.insert visited
146        val member = BM.member(!bitMatrix)        val member = BM.member(!bitMatrix)
147    
# Line 190  Line 193 
193                   else                   else
194                      case (!dstCol, !srcCol) of                      case (!dstCol, !srcCol) of
195                        (SPILLED, PSEUDO) => savings(~1)                        (SPILLED, PSEUDO) => savings(~1)
196                      | (MEMREG m, PSEUDO) => savings(m)                      | (MEMREG(m, _), PSEUDO) => savings(m)
197                      | (SPILL_LOC s, PSEUDO) => savings(~s)                      | (SPILL_LOC s, PSEUDO) => savings(~s)
198                      | (PSEUDO, SPILLED) => savings(~1)                      | (PSEUDO, SPILLED) => savings(~1)
199                      | (PSEUDO, MEMREG m) => savings(m)                      | (PSEUDO, MEMREG(m, _)) => savings(m)
200                      | (PSEUDO, SPILL_LOC s) => savings(~s)                      | (PSEUDO, SPILL_LOC s) => savings(~s)
201                      | _ => (if debug then print "0 (other)\n" else ();                      | _ => (if debug then print "0 (other)\n" else ();
202                              moveSavings(mvs, pinned, total))                              moveSavings(mvs, pinned, total))
# Line 428  Line 431 
431        fun spillIt{graph = G as GRAPH{mode, ...}, nodes,        fun spillIt{graph = G as GRAPH{mode, ...}, nodes,
432                    copyInstr, spill, spillSrc, spillCopyTmp,                    copyInstr, spill, spillSrc, spillCopyTmp,
433                    reload, reloadDst, renameSrc, cellkind} =                    reload, reloadDst, renameSrc, cellkind} =
434        let val nodes = if isOn(mode,SPILL_PROPAGATION) then        let
435              val nodes = if isOn(mode,SPILL_PROPAGATION) then
436                            spillPropagation G nodes else nodes                            spillPropagation G nodes else nodes
437            val _ = if isOn(mode,SPILL_COALESCING) then            val _ = if isOn(mode,SPILL_COALESCING) then
438                       spillCoalescing G nodes else ()                       spillCoalescing G nodes else ()

Legend:
Removed from v.733  
changed lines
  Added in v.1009

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0