Ignore:
Timestamp:
Sep 14, 2016, 2:56:54 PM (3 years ago)
Author:
nmedfort
Message:

Work on multiplexing and distribution passes + a few AST modification bug fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/pablo_toolchain.cpp

    r5032 r5156  
    1919#include <pablo/optimizers/pablo_automultiplexing.hpp>
    2020#include <pablo/optimizers/pablo_bddminimization.h>
     21#include <pablo/optimizers/booleanreassociationpass.h>
    2122#include <pablo/optimizers/distributivepass.h>
    2223#include <pablo/optimizers/schedulingprepass.h>
     
    2829#include <llvm/Support/CommandLine.h>
    2930#include <llvm/Support/FileSystem.h>
    30 
     31#ifdef PRINT_TIMING_INFORMATION
     32#include <hrtime.h>
     33#endif
    3134
    3235namespace pablo {
     
    3437
    3538static cl::OptionCategory PabloOptions("Pablo Options", "These options control printing, generation and instrumentation of Pablo intermediate code.");
    36 const cl::OptionCategory * pablo_toolchain_flags() {return &PabloOptions;};
     39
     40const cl::OptionCategory * pablo_toolchain_flags() {
     41    return &PabloOptions;
     42}
    3743   
    3844   
     
    205211    }
    206212#ifdef ENABLE_MULTIPLEXING
    207     if (PabloOptimizationsOptions.isSet(EnableLowering) || PabloOptimizationsOptions.isSet(EnablePreDistribution) || PabloOptimizationsOptions.isSet(EnablePostDistribution)) {
    208         READ_CYCLE_COUNTER(coalescing_start);
    209         CanonicalizeDFG::transform(*function);
    210         READ_CYCLE_COUNTER(coalescing_end);
    211     }
     213//    if (PabloOptimizationsOptions.isSet(EnableLowering) || PabloOptimizationsOptions.isSet(EnablePreDistribution) || PabloOptimizationsOptions.isSet(EnablePostDistribution)) {
     214//        READ_CYCLE_COUNTER(coalescing_start);
     215//        CanonicalizeDFG::transform(*function);
     216//        READ_CYCLE_COUNTER(coalescing_end);
     217//    }
    212218    if (PabloOptimizationsOptions.isSet(EnablePreDistribution)) {
    213219        READ_CYCLE_COUNTER(pre_distribution_start);
    214         DistributivePass::optimize(*function);
     220        BooleanReassociationPass::optimize(*function);
    215221        READ_CYCLE_COUNTER(pre_distribution_end);
    216222    }
     
    219225        MultiplexingPass::optimize(*function);
    220226        READ_CYCLE_COUNTER(multiplexing_end);
    221         if (PabloOptimizationsOptions.isSet(EnableLowering) || PabloOptimizationsOptions.isSet(EnablePreDistribution) || PabloOptimizationsOptions.isSet(EnablePostDistribution)) {
    222             CanonicalizeDFG::transform(*function);
    223         }
     227//        if (PabloOptimizationsOptions.isSet(EnableLowering) || PabloOptimizationsOptions.isSet(EnablePreDistribution) || PabloOptimizationsOptions.isSet(EnablePostDistribution)) {
     228//            CanonicalizeDFG::transform(*function);
     229//        }
    224230    }
    225231    if (PabloOptimizationsOptions.isSet(EnablePostDistribution)) {
    226232        READ_CYCLE_COUNTER(post_distribution_start);
    227         DistributivePass::optimize(*function);
     233        BooleanReassociationPass::optimize(*function);
    228234        READ_CYCLE_COUNTER(post_distribution_end);
    229235    }
     
    244250    distribution = SUMMARIZE_VARIADIC_DISTRIBUTION(function);
    245251    #endif
    246     if (PabloOptimizationsOptions.isSet(EnableLowering) || PabloOptimizationsOptions.isSet(EnablePreDistribution) || PabloOptimizationsOptions.isSet(EnablePostDistribution)) {
    247         READ_CYCLE_COUNTER(lowering_start);
    248         FactorizeDFG::transform(*function);
    249         READ_CYCLE_COUNTER(lowering_end);
    250     }
    251     if (PabloOptimizationsOptions.isSet(EnablePrePassScheduling)) {
    252         READ_CYCLE_COUNTER(scheduling_start);
    253         SchedulingPrePass::optimize(*function);
    254         READ_CYCLE_COUNTER(scheduling_end);
    255     }
     252//    if (PabloOptimizationsOptions.isSet(EnableLowering) || PabloOptimizationsOptions.isSet(EnablePreDistribution) || PabloOptimizationsOptions.isSet(EnablePostDistribution)) {
     253//        READ_CYCLE_COUNTER(lowering_start);
     254//        FactorizeDFG::transform(*function);
     255//        READ_CYCLE_COUNTER(lowering_end);
     256//    }
     257//    if (PabloOptimizationsOptions.isSet(EnablePrePassScheduling)) {
     258//        READ_CYCLE_COUNTER(scheduling_start);
     259//        SchedulingPrePass::optimize(*function);
     260//        READ_CYCLE_COUNTER(scheduling_end);
     261//    }
    256262#endif
    257263#ifdef PRINT_TIMING_INFORMATION
     
    277283    std::cerr << "  PRE-DISTRIBUTION TIME: " << (pre_distribution_end - pre_distribution_start) << std::endl;
    278284    std::cerr << "  MULTIPLEXING TIME: " << (multiplexing_end - multiplexing_start) << std::endl;
    279     std::cerr << "  MULTIPLEXING SEED: " << MultiplexingPass::SEED << std::endl;
    280     std::cerr << "  MULTIPLEXING NODES USED: " << MultiplexingPass::NODES_USED << std::endl;
    281     std::cerr << "  MULTIPLEXING NODES ALLOCATED: " << MultiplexingPass::NODES_ALLOCATED << std::endl;
    282285    std::cerr << "  LOWERING TIME: " << (lowering_end - lowering_start) << std::endl;
    283286    std::cerr << "  FLATTENIF TIME: " << (flattenif_end - flattenif_start) << std::endl;
Note: See TracChangeset for help on using the changeset viewer.