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 /MLRISC/releases/release-110.64/IR/mlrisc-reshape-branches.sml
ViewVC logotype

Diff of /MLRISC/releases/release-110.64/IR/mlrisc-reshape-branches.sml

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

revision 606, Sun Apr 9 23:10:59 2000 UTC revision 624, Fri Apr 21 03:06:21 2000 UTC
# Line 82  Line 82 
82               else ()               else ()
83           | _ => ()           | _ => ()
84    
85           fun follow i =
86           let fun chase j =
87                   case #out_edges cfg j of
88                     [(_,k,_)] => if k = i then k else chase k
89                   | _ => j
90           in chase i end
91    
92         (* Falls thru case should be likely for forward branches. *)         (* Falls thru case should be likely for forward branches. *)
93         fun should_flip_forward_branches(         fun should_flip_forward_branches(
94             (i,j,CFG.EDGE{w=w1,k=CFG.BRANCH b1,...}),             (i,j,CFG.EDGE{w=w1,k=CFG.BRANCH b1,...}),
95             (_,k,CFG.EDGE{w=w2,k=CFG.BRANCH b2,...})) =             (_,k,CFG.EDGE{w=w2,k=CFG.BRANCH b2,...})) =
96               (b1 andalso !w1 > !w2 andalso not(dominates(j,i)))               (b1 andalso !w1 > !w2 andalso not(dominates(follow j,i)))
97               orelse               orelse
98               (b2 andalso !w2 > !w1 andalso not(dominates(k,i)))               (b2 andalso !w2 > !w1 andalso not(dominates(follow k,i)))
99          | should_flip_forward_branches _ = false          | should_flip_forward_branches _ = false
100    
101         (*         (*
# Line 148  Line 155 
155     in  #forall_nodes cfg (fn x => restructure_conditionals x handle _ => ());     in  #forall_nodes cfg (fn x => restructure_conditionals x handle _ => ());
156         #forall_nodes loop restructure_loop;         #forall_nodes loop restructure_loop;
157         if !changed then IR.changed IR else ();         if !changed then IR.changed IR else ();
158           Util.mergeAllEdges IR;
159         IR         IR
160     end     end
161    

Legend:
Removed from v.606  
changed lines
  Added in v.624

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