Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Log of /sml/trunk/src/compiler/CodeGen/cpscompile/cpsBranchProb.sml
[smlnj] / sml / trunk / src / compiler / CodeGen / cpscompile / cpsBranchProb.sml  
ViewVC logotype

Log of /sml/trunk/src/compiler/CodeGen/cpscompile/cpsBranchProb.sml

Parent Directory Parent Directory


Sticky Revision:
(Current path doesn't exist after revision 2161)

Revision 1174 - (view) (download) (annotate) - [select for diffs]
Modified Sat Mar 23 21:14:40 2002 UTC (17 years, 4 months ago) by leunga
File length: 7407 byte(s)
Diff to previous 1168

    Added some new primops for creating/manipulating temporary "C" objects
    allocated on the ml heap.

Revision 1168 - (view) (download) (annotate) - [select for diffs]
Added Fri Mar 22 19:19:32 2002 UTC (17 years, 4 months ago) by george
File length: 7401 byte(s)
Implemented the Ball-Larus branch prediction-heuristic, and
incorporated graphical viewers for control flow graphs.

Ball-Larus Heuristic:
---------------------
See the file compiler/CodeGen/cpscompile/cpsBranchProb.sml.

By design it uses the Dempster-Shafer theory for combining
probabilities.  For example, in the function:

    fun f(n,acc) = if n = 0 then acc else f(n-1, n*acc)

the ball-larus heuristics predicts that the n=0 is unlikely
(OH-heuristic), and the 'then' branch is unlikely because of the
RH-heuristic -- giving the 'then' branch an even lower combined
probability using the Dempster-Shater theory.

Finally, John Reppy's loop analysis in MLRISC, further lowers the
probability of the 'then' branch because of the loop in the else
branch.


Graphical Viewing:
------------------
I merely plugged in Allen's graphical viewers into the compiler. The
additional code is not much. At the top level, saying:

	Control.MLRISC.getFlag "cfg-graphical-view" := true;

will display the graphical view of the control flow graph just before
back-patching.  daVinci must be in your path for this to work. If
daVinci is not available, then the default viewer can be changed
using:

	Control.MLRISC.getString "viewer"

which can be set to "dot" or "vcg" for the corresponding viewers. Of
course, these viewers must be in your path.

The above will display the compilation unit at the level of clusters,
many of which are small, boring, and un-interesting. Also setting:

	Control.MLRISC.getInt "cfg-graphical-view_size"

will display clusters that are larger than the value set by the above.

This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

Sort log by:

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