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/ra-spill-with-renaming.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/ra/ra-spill-with-renaming.sml

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

revision 641, Thu May 11 01:16:45 2000 UTC revision 646, Tue May 16 02:52:54 2000 UTC
# Line 197  Line 197 
197      * The following function performs spilling.      * The following function performs spilling.
198      *)      *)
199     fun spillRewrite     fun spillRewrite
200          {graph=G as G.GRAPH{showReg, spilledRegs, nodes, mode, ...},          {graph=G as G.GRAPH{showReg, spilledRegs, nodes, mode, dedicated, ...},
201           spill : spill,           spill : spill,
202           spillCopyTmp : spillCopyTmp,           spillCopyTmp : spillCopyTmp,
203           spillSrc : spillSrc,           spillSrc : spillSrc,
# Line 218  Line 218 
218    
219         val insnDefUse = P.defUse cellkind         val insnDefUse = P.defUse cellkind
220    
221           fun hasNonDedicated rs =
222           let fun isDedicated r = Array.sub(dedicated,r) handle _ => false
223               fun loop [] = false
224                 | loop(r::rs) =
225                   if isDedicated r then loop rs else true
226           in  loop rs end
227    
228         (* Merge prohibited registers *)         (* Merge prohibited registers *)
229         val enterSpill = Intmap.add spilledRegs         val enterSpill = Intmap.add spilledRegs
230         val addProh = app (fn r => enterSpill(r,true))         val addProh = app (fn r => enterSpill(r,true))
# Line 514  Line 521 
521                 let val spillRegs = getSpills pt                 let val spillRegs = getSpills pt
522                     val reloadRegs = getReloads pt                     val reloadRegs = getReloads pt
523                 in  case (spillRegs, reloadRegs) of                 in  case (spillRegs, reloadRegs) of
524                       ([], []) => loop(rest, dec pt, [], instr::newInstrs)                       ([], []) =>
525                           let val env' =
526                                  case env of
527                                    [] => []
528                                  | _ => let val (defs, uses) = insnDefUse instr
529                                         in  if hasNonDedicated defs orelse
530                                                hasNonDedicated uses then []
531                                             else env
532                                         end
533                           in  loop(rest, dec pt, env', instr::newInstrs)
534                           end
535                     | _ =>                     | _ =>
536                       (* Eliminate duplicates from the spill/reload candidates *)                       (* Eliminate duplicates from the spill/reload candidates *)
537                       let val killRegs   = getKills pt                       let val killRegs   = getKills pt

Legend:
Removed from v.641  
changed lines
  Added in v.646

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