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/optimizers/pablo_simplifier.cpp

    r5202 r5217  
    11#include <pablo/optimizers/pablo_simplifier.hpp>
     2#include <pablo/pablo_kernel.h>
    23#include <pablo/codegenstate.h>
    34#include <pablo/expression_map.hpp>
    4 #include <pablo/function.h>
     5//#include <pablo/function.h>
    56#include <pablo/analysis/pabloverifier.hpp>
    6 #include <boost/container/flat_set.hpp>
    7 #include <boost/container/flat_map.hpp>
     7//#include <boost/container/flat_set.hpp>
     8//#include <boost/container/flat_map.hpp>
    89#include <pablo/printer_pablos.h>
    9 #include <iostream>
     10//#include <iostream>
    1011
    1112using namespace boost;
     
    559560 * @brief deadCodeElimination
    560561 ** ------------------------------------------------------------------------------------------------------------- */
    561 void Simplifier::deadCodeElimination(PabloFunction & f) {
    562 
    563     deadCodeElimination(f.getEntryBlock());
    564 
    565     for (unsigned i = 0; i < f.getNumOfVariables(); ++i) {
    566         Var * var = f.getVariable(i);
     562void Simplifier::deadCodeElimination(PabloKernel * kernel) {
     563
     564    deadCodeElimination(kernel->getEntryBlock());
     565
     566    for (unsigned i = 0; i < kernel->getNumOfVariables(); ++i) {
     567        Var * var = kernel->getVariable(i);
    567568        bool unused = true;
    568569        for (PabloAST * user : var->users()) {
     
    642643 * @brief optimize
    643644 ** ------------------------------------------------------------------------------------------------------------- */
    644 bool Simplifier::optimize(PabloFunction & function) {
    645     redundancyElimination(function.getEntryBlock());
    646     strengthReduction(function.getEntryBlock());
    647     deadCodeElimination(function);
     645bool Simplifier::optimize(PabloKernel * kernel) {
     646    redundancyElimination(kernel->getEntryBlock());
     647    strengthReduction(kernel->getEntryBlock());
     648    deadCodeElimination(kernel);
    648649    #ifndef NDEBUG
    649     PabloVerifier::verify(function, "post-simplification");
     650    PabloVerifier::verify(kernel, "post-simplification");
    650651    #endif
    651652    return true;
Note: See TracChangeset for help on using the changeset viewer.