Changeset 5032


Ignore:
Timestamp:
May 6, 2016, 3:17:27 PM (17 months ago)
Author:
xuedongx
Message:

Add a Pablo option to flatten all the Ifs in the Pablo AST.

Location:
icGREP/icgrep-devel/icgrep
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/CMakeLists.txt

    r5022 r5032  
    5555SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_BOOST")
    5656
    57 SET(PABLO_SRC pablo/pabloAST.cpp pablo/ps_if.cpp pablo/ps_while.cpp pablo/function.cpp pablo/codegenstate.cpp pablo/builder.cpp pablo/symbol_generator.cpp pablo/printer_pablos.cpp pablo/pablo_toolchain.cpp)
     57SET(PABLO_SRC pablo/pabloAST.cpp pablo/ps_if.cpp pablo/ps_while.cpp pablo/function.cpp pablo/codegenstate.cpp pablo/builder.cpp pablo/symbol_generator.cpp pablo/printer_pablos.cpp pablo/pablo_toolchain.cpp pablo/passes/flattenif.cpp)
    5858SET(PABLO_SRC ${PABLO_SRC} pablo/pablo_compiler.cpp pablo/carry_manager.cpp pablo/carry_data.cpp IDISA/idisa_builder.cpp IDISA/idisa_avx_builder.cpp IDISA/idisa_i64_builder.cpp IDISA/idisa_sse_builder.cpp IDISA/idisa_target.cpp)
    5959SET(PABLO_SRC ${PABLO_SRC} kernels/s2p_kernel.cpp kernels/kernel.cpp kernels/instance.cpp)
  • icGREP/icgrep-devel/icgrep/pablo/pablo_toolchain.cpp

    r5031 r5032  
    1414#include <pablo/optimizers/codemotionpass.h>
    1515#include <pablo/passes/flattenassociativedfg.h>
     16#include <pablo/passes/flattenif.hpp>
    1617#include <pablo/passes/factorizedfg.h>
    1718#ifdef ENABLE_MULTIPLEXING
     
    4546   
    4647static cl::opt<std::string> PabloOutputFilename("print-pablo-output", cl::init(""), cl::desc("output Pablo filename"), cl::cat(PabloOptions));
     48static cl::opt<bool> Flatten("flatten-if", cl::init(false), cl::desc("Flatten all the Ifs in the Pablo AST"), cl::cat(PabloOptions));
    4749
    4850static cl::bits<PabloCompilationFlags>
     
    181183#ifdef PRINT_TIMING_INFORMATION
    182184    timestamp_t simplification_start = 0, simplification_end = 0;
     185    timestamp_t flattenif_start = 0, flattenif_end = 0;
    183186    timestamp_t coalescing_start = 0, coalescing_end = 0;
    184187    timestamp_t sinking_start = 0, sinking_end = 0;
     
    195198        Simplifier::optimize(*function);
    196199        READ_CYCLE_COUNTER(simplification_end);
     200    }
     201    if (Flatten){
     202        READ_CYCLE_COUNTER(flattenif_start);
     203        FlattenIf::transform(*function);
     204        READ_CYCLE_COUNTER(flattenif_end);
    197205    }
    198206#ifdef ENABLE_MULTIPLEXING
     
    273281    std::cerr << "  MULTIPLEXING NODES ALLOCATED: " << MultiplexingPass::NODES_ALLOCATED << std::endl;
    274282    std::cerr << "  LOWERING TIME: " << (lowering_end - lowering_start) << std::endl;
     283    std::cerr << "  FLATTENIF TIME: " << (flattenif_end - flattenif_start) << std::endl;
    275284    std::cerr << "  POST-DISTRIBUTION TIME: " << (post_distribution_end - post_distribution_start) << std::endl;
    276285    std::cerr << "  SCHEDULING TIME: " << (scheduling_end - scheduling_start) << std::endl;
Note: See TracChangeset for help on using the changeset viewer.