PreviousUpNext

15.4.218  src/lib/compiler/back/low/block-placement/make-final-basic-block-order-list-g.pkg

## make-final-basic-block-order-list-g.pkg
#
# See overview comments in
#
#     src/lib/compiler/back/low/block-placement/make-final-basic-block-order-list.api

# Compiled by:
#     src/lib/compiler/back/low/lib/lowhalf.lib



###              "Efficiency is intelligent laziness."
###
###                           -- David Dunham

stipulate
    package lhc =  lowhalf_control;                                             # lowhalf_control                       is from   src/lib/compiler/back/low/control/lowhalf-control.pkg
    package odg =  oop_digraph;                                                 # oop_digraph                           is from   src/lib/graph/oop-digraph.pkg
herein


    # This generic is invoked (only) in:
    #
    #     src/lib/compiler/back/low/main/main/backend-lowhalf-g.pkg
    #
    generic package   make_final_basic_block_order_list_g   (
        #             ===================================
        #
        package mcg: Machcode_Controlflow_Graph;                                # Machcode_Controlflow_Graph            is from   src/lib/compiler/back/low/mcg/machcode-controlflow-graph.api
        package mu:  Machcode_Universals;                                       # Machcode_Universals                   is from   src/lib/compiler/back/low/code/machcode-universals.api
    )
    : (weak) Make_Final_Basic_Block_Order_List                                  # Make_Final_Basic_Block_Order_List     is from   src/lib/compiler/back/low/block-placement/make-final-basic-block-order-list.api
    {
        # Export to client packages:
        #       
        package mcg = mcg;                                                      # "mcg" == "machcode_controlflow_graph".

        stipulate
            package default_placement
                =
                default_block_placement_g (                                     # default_block_placement               is from   src/lib/compiler/back/low/block-placement/default-block-placement-g.pkg
                    mcg
                );

            package weighted_placement
                = 
                weighted_block_placement_g (                                    # weighted_block_placement_g            is from   src/lib/compiler/back/low/block-placement/weighted-block-placement-g.pkg
                    #
                    package mcg =  mcg;                                         # "mcg" == "machcode_controlflow_graph".
                    package mu  =  mu;                                          # "mu"  == "machcode_universals".
                );

            do_weighted_block_placement
                =
                lhc::make_bool (                                                # Default value is FALSE.
                    "do_weighted_block_placement",
                    "TRUE to do weighted block placement"
                );
        herein

            fun make_final_basic_block_order_list
                    #
                    (mcg  as  odg::DIGRAPH graph)
                =
                if *do_weighted_block_placement   weighted_placement::make_final_basic_block_order_list  mcg;
                else                               default_placement::make_final_basic_block_order_list  mcg;   # Default case.
                fi;
        end;
    };
end;

## COPYRIGHT (c) 2002 Bell Labs, Lucent Technologies
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext