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/ssa-instrgen.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/SSA/ssa-instrgen.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 37  Line 37 
37             let val v = List.nth(uses,x)             let val v = List.nth(uses,x)
38             in  if v < 0 then             in  if v < 0 then
39                    (case const v of                    (case const v of
40                       SP.OT.IMMED i => T.LI i                       SP.OT.INT i => T.LI i
41                       | SP.OT.INTINF i => T.LIInf i
42                     | SP.OT.OPERAND opnd => error "useOf"                     | SP.OT.OPERAND opnd => error "useOf"
43                    )                    )
44                 else T.REG(ty,v)                 else T.REG(ty,v)
45             end             end
46         fun stm(T'.MV(ty,x,e)) = T.MV(ty,defOf x,rexp e)         fun (* stm(T'.MV(ty,x,e)) = T.MV(ty,defOf x,rexp e)
47           | stm(T'.STORE(ty,a,b,mem)) = T.STORE(ty,rexp a,rexp b,R.memory)           | stm(T'.STORE(ty,a,b,mem)) = T.STORE(ty,rexp a,rexp b,R.memory)
48           | stm(T'.RTL{e, ...}) = stm e           | *) stm(T'.RTL{e, ...}) = stm e
49           | stm s = error("stm: "^RTL.rtlToString s)           | stm s = error("stm: "^RTL.rtlToString s)
50         and rexp(T'.REG(ty,x)) = useOf(ty, x)         and (* rexp(T'.REG(ty,x)) = useOf(ty, x)
51           | rexp(T'.LI i) = T.LI i           | rexp(T'.LI i) = T.LI i
52           | rexp(T'.LI32 i) = T.LI32 i           | rexp(T'.LI32 i) = T.LI32 i
53           | rexp(T'.ADD(ty,a,b)) = T.ADD(ty,rexp a, rexp b)           | rexp(T'.ADD(ty,a,b)) = T.ADD(ty,rexp a, rexp b)
# Line 73  Line 74 
74           | rexp(T'.SLL(ty,a,b)) = T.SLL(ty,rexp a,rexp b)           | rexp(T'.SLL(ty,a,b)) = T.SLL(ty,rexp a,rexp b)
75           | rexp(T'.CVTI2I(ty,ext,ty',a)) = T.CVTI2I(ty,ext,ty',rexp a)           | rexp(T'.CVTI2I(ty,ext,ty',a)) = T.CVTI2I(ty,ext,ty',rexp a)
76           | rexp(T'.LOAD(ty,a,mem)) = T.LOAD(ty,rexp a,R.memory)           | rexp(T'.LOAD(ty,a,mem)) = T.LOAD(ty,rexp a,R.memory)
77           | rexp e = error("rexp: "^RTL.expToString e)           | *) rexp e = error("rexp: "^RTL.expToString e)
78     in  stm rtl end     in  stm rtl end
79    
80     (*     (*
# Line 93  Line 94 
94               entryLabel   = can'tUse,               entryLabel   = can'tUse,
95               comment      = can'tUse,               comment      = can'tUse,
96               annotation   = can'tUse,               annotation   = can'tUse,
97               exitBlock    = can'tUse,               exitBlock    = can'tUse
              alias        = can'tUse,  
              phi          = can'tUse  
98             }             }
99    
100         val S.STREAM{emit, ...} = MLTreeComp.selectInstructions instrStream         val S.STREAM{emit, ...} = MLTreeComp.selectInstructions instrStream
# Line 131  Line 130 
130      *)      *)
131     fun insert (SSA as G.GRAPH ssa) =     fun insert (SSA as G.GRAPH ssa) =
132     let val getOperands =     let val getOperands =
133             P.defUse{immed   = SSA.immed SSA,             P.defUse(SP.OT.makeNewValueNumbers(SSA.operandTbl SSA))
                     operand = SSA.operand SSA  
                    }  
134         val pinnedUseTbl = SSA.pinnedUseTbl         val pinnedUseTbl = SSA.pinnedUseTbl
135         val pinnedDefTbl = SSA.pinnedDefTbl         val pinnedDefTbl = SSA.pinnedDefTbl
136         fun isPinnedUse r = W8A.sub(pinnedUseTbl,r) <> 0w0 handle _ => false         fun isPinnedUse r = W8A.sub(pinnedUseTbl,r) <> 0w0 handle _ => false
# Line 148  Line 145 
145         val renameVar = SSA.newRenamedVar SSA         val renameVar = SSA.newRenamedVar SSA
146    
147         exception Renaming         exception Renaming
148         val renameMap = Intmap.new(32, Renaming)         val renameMap = IntHashTable.mkTable(32, Renaming)
149         val lookupRenaming = Intmap.map renameMap         val lookupRenaming = IntHashTable.lookup renameMap
150         val addRenaming = Intmap.add renameMap         val addRenaming = IntHashTable.insert renameMap
151    
152         fun addInstrs(block, instrs) =         fun addInstrs(block, instrs) =
153         let val n = length instrs         let val n = length instrs

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