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/trunk/block-placement/jump-chain-elim-fn.sml
ViewVC logotype

Diff of /MLRISC/trunk/block-placement/jump-chain-elim-fn.sml

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

revision 1128, Fri Mar 8 21:05:27 2002 UTC revision 1129, Sat Mar 9 03:21:44 2002 UTC
# Line 3  Line 3 
3   * COPYRIGHT (c) 2002 Bell Labs, Lucent Technologies   * COPYRIGHT (c) 2002 Bell Labs, Lucent Technologies
4   *   *
5   * Collapse jumps to jumps.   * Collapse jumps to jumps.
6     *
7     * TODO:
8     *      check for jumps to the next block.
9     *      jump tables (SWITCH edges).
10   *)   *)
11    
12  functor JumpChainElimFn (  functor JumpChainElimFn (
# Line 24  Line 28 
28      structure G = Graph      structure G = Graph
29    
30    (* flags *)    (* flags *)
31      val disable = MLRiscControl.mkFlag ("disable-jump-chain-elim",      val disable = MLRiscControl.mkFlag (
32              "disable-jump-chain-elim",
33                                          "whether jump chain elimination is disabled")                                          "whether jump chain elimination is disabled")
34      val dumpCFG = MLRiscControl.mkFlag ("dump-cfg-jump-chain-elim",      val dumpCFG = MLRiscControl.mkFlag (
35              "dump-cfg-jump-chain-elim",
36                                          "whether flow graph is shown after jump chain elimination")                                          "whether flow graph is shown after jump chain elimination")
37      val dumpStrm = MLRiscControl.debug_stream      val dumpStrm = MLRiscControl.debug_stream
38    
# Line 92  Line 98 
98                      | [(_, dst1, info as CFG.EDGE{k=CFG.BRANCH true, ...}), e2] => (                      | [(_, dst1, info as CFG.EDGE{k=CFG.BRANCH true, ...}), e2] => (
99                          case followChain dst1                          case followChain dst1
100                           of SOME(dst', lab) => (                           of SOME(dst', lab) => (
101                                setTargets [lab, labelOf(#2 e2)];                                setTargets [labelOf(#2 e2), lab];
102                                set_out_edges (blkId, [(blkId, dst', info), e2]))                                set_out_edges (blkId, [(blkId, dst', info), e2]))
103                            | NONE => ()                            | NONE => ()
104                          (* end case *))                          (* end case *))
105                      | [e1, (_, dst2, info as CFG.EDGE{k=CFG.BRANCH true, ...})] => (                      | [e1, (_, dst2, info as CFG.EDGE{k=CFG.BRANCH true, ...})] => (
106                          case followChain dst2                          case followChain dst2
107                           of SOME(dst', lab) => (                           of SOME(dst', lab) => (
108                                setTargets [lab, labelOf(#2 e1)];                                setTargets [labelOf(#2 e1), lab];
109                                set_out_edges (blkId, [e1, (blkId, dst', info)]))                                set_out_edges (blkId, [e1, (blkId, dst', info)]))
110                            | NONE => ()                            | NONE => ()
111                          (* end case *))                          (* end case *))
 (* FIXME: do something about jump tables *)  
112                      | _ => ()                      | _ => ()
113                    (* end case *)                    (* end case *)
114                  end                  end

Legend:
Removed from v.1128  
changed lines
  Added in v.1129

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