Ignore:
Timestamp:
Nov 18, 2016, 1:46:55 PM (2 years ago)
Author:
nmedfort
Message:

Merged PabloFunction? and PabloKernel? classes. Updated projects where necessary.

File:
1 edited

Legend:

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

    r5202 r5217  
    55 */
    66
    7 #include <string>
    8 #include <iostream>
    9 #include <fstream>
    10 
    117#include <pablo/pablo_toolchain.h>
     8#include <pablo/pablo_kernel.h>
    129#include <pablo/pablo_compiler.h>
    1310#include <pablo/optimizers/pablo_simplifier.hpp>
     
    2320#include <pablo/optimizers/schedulingprepass.h>
    2421#endif
    25 #include <pablo/function.h>
     22#include <pablo/prototype.h>
    2623#include <pablo/analysis/pabloverifier.hpp>
    2724#include <pablo/printer_pablos.h>
    28 #include <sstream>
    2925#include <llvm/Support/CommandLine.h>
    3026#include <llvm/Support/FileSystem.h>
     
    3228#include <hrtime.h>
    3329#endif
     30#include <string>
     31#include <iostream>
     32#include <fstream>
     33#include <sstream>
    3434
    3535namespace pablo {
     
    172172#endif
    173173
    174 void pablo_function_passes(PabloFunction * function) {
     174void pablo_function_passes(PabloKernel * kernel) {
    175175   
    176176    if (DebugOptions.isSet(PrintCompiledREcode)) {
     
    178178        llvm::raw_os_ostream cerr(std::cerr);
    179179        cerr << "Initial Pablo AST:\n";
    180         PabloPrinter::print(*function, cerr);
     180        PabloPrinter::print(kernel, cerr);
    181181    }
    182182   
    183183    #ifndef NDEBUG
    184     PabloVerifier::verify(*function, "creation");
     184    PabloVerifier::verify(kernel, "creation");
    185185    #endif
    186186
     
    202202    if (!PabloOptimizationsOptions.isSet(DisableSimplification)) {
    203203        READ_CYCLE_COUNTER(simplification_start);
    204         Simplifier::optimize(*function);
     204        Simplifier::optimize(kernel);
    205205        READ_CYCLE_COUNTER(simplification_end);
    206206    }
    207207    if (Flatten){
    208208        READ_CYCLE_COUNTER(flattenif_start);
    209         FlattenIf::transform(*function);
     209        FlattenIf::transform(kernel);
    210210        READ_CYCLE_COUNTER(flattenif_end);
    211211    }
     
    213213//    if (PabloOptimizationsOptions.isSet(EnableLowering) || PabloOptimizationsOptions.isSet(EnablePreDistribution) || PabloOptimizationsOptions.isSet(EnablePostDistribution)) {
    214214//        READ_CYCLE_COUNTER(coalescing_start);
    215 //        CanonicalizeDFG::transform(*function);
     215//        CanonicalizeDFG::transform(kernel);
    216216//        READ_CYCLE_COUNTER(coalescing_end);
    217217//    }
    218218    if (PabloOptimizationsOptions.isSet(EnablePreDistribution)) {
    219219        READ_CYCLE_COUNTER(pre_distribution_start);
    220         BooleanReassociationPass::optimize(*function);
     220        BooleanReassociationPass::optimize(kernel);
    221221        READ_CYCLE_COUNTER(pre_distribution_end);
    222222    }
    223223    if (PabloOptimizationsOptions.isSet(EnableMultiplexing)) {
    224224        READ_CYCLE_COUNTER(multiplexing_start);
    225         MultiplexingPass::optimize(*function);
     225        MultiplexingPass::optimize(kernel);
    226226        READ_CYCLE_COUNTER(multiplexing_end);
    227227//        if (PabloOptimizationsOptions.isSet(EnableLowering) || PabloOptimizationsOptions.isSet(EnablePreDistribution) || PabloOptimizationsOptions.isSet(EnablePostDistribution)) {
    228 //            CanonicalizeDFG::transform(*function);
     228//            CanonicalizeDFG::transform(kernel);
    229229//        }
    230230    }
    231231    if (PabloOptimizationsOptions.isSet(EnablePostDistribution)) {
    232232        READ_CYCLE_COUNTER(post_distribution_start);
    233         BooleanReassociationPass::optimize(*function);
     233        BooleanReassociationPass::optimize(kernel);
    234234        READ_CYCLE_COUNTER(post_distribution_end);
    235235    }
     
    237237    if (PabloOptimizationsOptions.isSet(EnableCodeMotion)) {
    238238        READ_CYCLE_COUNTER(sinking_start);
    239         CodeMotionPass::optimize(*function);
     239        CodeMotionPass::optimize(kernel);
    240240        READ_CYCLE_COUNTER(sinking_end);
    241241    }
     
    245245        llvm::raw_os_ostream cerr(std::cerr);
    246246        cerr << "Unlowered Pablo AST:\n";
    247         PabloPrinter::print(*function, cerr);
     247        PabloPrinter::print(kernel, cerr);
    248248    }
    249249    #ifdef PRINT_TIMING_INFORMATION
     
    252252//    if (PabloOptimizationsOptions.isSet(EnableLowering) || PabloOptimizationsOptions.isSet(EnablePreDistribution) || PabloOptimizationsOptions.isSet(EnablePostDistribution)) {
    253253//        READ_CYCLE_COUNTER(lowering_start);
    254 //        FactorizeDFG::transform(*function);
     254//        FactorizeDFG::transform(kernel);
    255255//        READ_CYCLE_COUNTER(lowering_end);
    256256//    }
    257257//    if (PabloOptimizationsOptions.isSet(EnablePrePassScheduling)) {
    258258//        READ_CYCLE_COUNTER(scheduling_start);
    259 //        SchedulingPrePass::optimize(*function);
     259//        SchedulingPrePass::optimize(kernel);
    260260//        READ_CYCLE_COUNTER(scheduling_end);
    261261//    }
     
    269269            llvm::raw_os_ostream cerr(std::cerr);
    270270            cerr << "Final Pablo AST:\n";
    271             PabloPrinter::print(*function, cerr);
     271            PabloPrinter::print(kernel, cerr);
    272272        } else {
    273273            std::error_code error;
    274274            llvm::raw_fd_ostream out(PabloOutputFilename, error, sys::fs::OpenFlags::F_None);
    275             PabloPrinter::print(*function, out);
     275            PabloPrinter::print(kernel, out);
    276276        }
    277277    }
Note: See TracChangeset for help on using the changeset viewer.