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/control/mlrisc-timing.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/control/mlrisc-timing.sml

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

revision 245, Sat Apr 17 18:47:12 1999 UTC revision 411, Fri Sep 3 00:25:03 1999 UTC
# Line 1  Line 1 
1  signature MLRISC_TIMING =  signature MLRISC_TIMING =
2  sig  sig
3    
4     type timing = {usr:Time.time,gc:Time.time,sys:Time.time}      val timePhase : string -> ('a -> 'b) -> 'a -> 'b
   
    val copy_propagation : timing ref  
    val cluster_to_IR    : timing ref  
    val guess            : timing ref  
    val IR_to_cluster    : timing ref  
    val ssa              : timing ref  
    val liveness         : timing ref  
    val scheduling       : timing ref  
    val ra               : timing ref  
    val emit_code        : timing ref  
   
5  end  end
6    
7  structure MLRISC_Timing : MLRISC_TIMING =  structure MLRISC_Timing : MLRISC_TIMING =
8  struct  struct
9    
10     structure T = Time     structure C = MLRISC_Control
    type timing = {usr:T.time,gc:T.time,sys:T.time}  
   
    val copy_propagation = ref {usr=T.zeroTime,gc=T.zeroTime,sys=T.zeroTime}  
    val cluster_to_IR    = ref {usr=T.zeroTime,gc=T.zeroTime,sys=T.zeroTime}  
    val guess            = ref {usr=T.zeroTime,gc=T.zeroTime,sys=T.zeroTime}  
    val IR_to_cluster    = ref {usr=T.zeroTime,gc=T.zeroTime,sys=T.zeroTime}  
    val ssa              = ref {usr=T.zeroTime,gc=T.zeroTime,sys=T.zeroTime}  
    val liveness         = ref {usr=T.zeroTime,gc=T.zeroTime,sys=T.zeroTime}  
    val scheduling       = ref {usr=T.zeroTime,gc=T.zeroTime,sys=T.zeroTime}  
    val ra               = ref {usr=T.zeroTime,gc=T.zeroTime,sys=T.zeroTime}  
    val emit_code        = ref {usr=T.zeroTime,gc=T.zeroTime,sys=T.zeroTime}  
11    
12       fun timePhase name f =
13       let val timing as ref {gc,usr,sys} = C.getTiming name
14           fun run x =
15           let val timer = Timer.startCPUTimer()
16               fun update timer =
17               let val {gc=gc',usr=usr',sys=sys'} = Timer.checkCPUTimer timer
18               in  timing := {gc=Time.+(gc,gc'),
19                              usr=Time.+(usr,usr'),
20                              sys=Time.+(sys,sys')}
21  end  end
22               val y = f x handle e => (update timer; raise e)
23           in  update timer; y
24           end
25       in  run end
26    
27  (*  end
  * $Log: mlrisc-timing.sml,v $  
  * Revision 1.1.1.1  1998/04/08 18:39:01  george  
  * Version 110.5  
  *  
  *)  

Legend:
Removed from v.245  
changed lines
  Added in v.411

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