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/SSA/ssa2cfg.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/SSA/ssa2cfg.sml

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

revision 695, Mon Aug 7 23:57:38 2000 UTC revision 744, Fri Dec 8 04:11:42 2000 UTC
# Line 97  Line 97 
97         val defSiteTbl  = SSA.defSiteTbl SSA (* definition sites *)         val defSiteTbl  = SSA.defSiteTbl SSA (* definition sites *)
98         val blockTbl    = SSA.blockTbl SSA   (* block table *)         val blockTbl    = SSA.blockTbl SSA   (* block table *)
99         val cellKindTbl = SSA.cellKindTbl SSA (* cellkinds *)         val cellKindTbl = SSA.cellKindTbl SSA (* cellkinds *)
100         val cellKindOf  = Intmap.mapWithDefault(cellKindTbl, C.GP)         val cellKindOf  = IntHashTable.find cellKindTbl
101           val cellKindOf  =
102                fn r => case cellKindOf r of SOME k => k | NONE => C.GP
103         val {sources, phis, ops, sinks} = SSA.nodes SSA (* linearized ssa *)         val {sources, phis, ops, sinks} = SSA.nodes SSA (* linearized ssa *)
104    
105         (*---------------------------------------------------------------------         (*---------------------------------------------------------------------
# Line 108  Line 110 
110         val mkCopies          = SP.copies         val mkCopies          = SP.copies
111         val namingConstraints = SP.namingConstraints         val namingConstraints = SP.namingConstraints
112         val opnKind           = RP.opnKind         val opnKind           = RP.opnKind
113         val defUse            = RP.defUse{immed=SSA.immed SSA,         val defUse            = RP.defUse(SP.OT.lookupValueNumbers
114                                           operand=SSA.operand SSA                                           (SSA.operandTbl SSA))
                                         }  
115         (* Should value d be in the resource r? *)         (* Should value d be in the resource r? *)
116         fun dstInReg(r) = isDedicatedDef r         fun dstInReg(r) = isDedicatedDef r
117         fun opDstInReg(k,r) = k = RP.FIX orelse isDedicatedDef r         fun opDstInReg(k,r) = k = RP.FIX orelse isDedicatedDef r
# Line 123  Line 124 
124          * Temporary data structures          * Temporary data structures
125          *---------------------------------------------------------------------*)          *---------------------------------------------------------------------*)
126         val Value = A.array(V, ~1) (* current value of resources *)         val Value = A.array(V, ~1) (* current value of resources *)
127         val Resources = Intmap.new(32, Nothing) (* names of all resources *)                 (* names of all resources *)
128           val Resources = IntHashTable.mkTable(32, Nothing)
129         val AvailIn  = A.array(N, [])         val AvailIn  = A.array(N, [])
130    
131         (* Mark the value of a resource *)         (* Mark the value of a resource *)
# Line 143  Line 145 
145         let         let
146    
147             (* Definitions of all resources *)             (* Definitions of all resources *)
148             val addResource   = Intmap.add Resources             val addResource   = IntHashTable.insert Resources
149             val LocalAvailOut = A.array(N, [])             val LocalAvailOut = A.array(N, [])
150    
151             (* Process a block *)             (* Process a block *)
# Line 255  Line 257 
257             val _ = #forall_nodes dom processBlock             val _ = #forall_nodes dom processBlock
258    
259             (* Definitions indexed by resource *)             (* Definitions indexed by resource *)
260             val LocalDefs = Intmap.new(32, Nothing)             val LocalDefs = IntHashTable.mkTable(32, Nothing)
261             val lookupLocalDef = Intmap.mapWithDefault(LocalDefs, [])             val lookupLocalDef = IntHashTable.find LocalDefs
262             val addLocalDef = Intmap.add LocalDefs             val lookupLocalDef =
263                   fn r => case lookupLocalDef r of SOME d => d | NONE => []
264               val addLocalDef = IntHashTable.insert LocalDefs
265    
266             val _ = A.appi (fn (X, localAvailOut) =>             val _ = A.appi (fn (X, localAvailOut) =>
267                               app (fn (r,v) =>                               app (fn (r,v) =>
# Line 266  Line 270 
270    
271             (* val _ = if debug then             (* val _ = if debug then
272                     (print "Resources=";                     (print "Resources=";
273                      Intmap.app (fn (r, _) => print(showVal r^" ")) Resources;                      IntHashTable.appi
274                           (fn (r, _) => print(showVal r^" ")) Resources;
275                      print "\n"                      print "\n"
276                     ) else ()                     ) else ()
277              *)              *)
# Line 343  Line 348 
348                 cleanup localAvailOut                 cleanup localAvailOut
349             end             end
350    
351         in  Intmap.app availAnalysis Resources         in  IntHashTable.appi availAnalysis Resources
352         end         end
353    
354         val _ = initialization()         val _ = initialization()
# Line 569  Line 574 
574                 else                 else
575                 let val loadConsts =                 let val loadConsts =
576                     case constOf src of                     case constOf src of
577                       SP.OT.IMMED i =>                       SP.OT.INT i =>
578                         InsnProps.loadImmed{t=dst, immed=i}::loadConsts                         InsnProps.loadImmed{t=dst, immed=i}::loadConsts
579                     | SP.OT.OPERAND opn =>                     | SP.OT.OPERAND opn =>
580                         InsnProps.loadOperand{t=dst, opn=opn}::loadConsts                         InsnProps.loadOperand{t=dst, opn=opn}::loadConsts

Legend:
Removed from v.695  
changed lines
  Added in v.744

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