Ignore:
Timestamp:
Feb 26, 2015, 3:35:19 PM (5 years ago)
Author:
nmedfort
Message:

added code sinking module; disabled by default as it hurts performance unless if-insertions occur.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/compiler.cpp

    r4516 r4521  
    1818#include <pablo/pablo_compiler.h>
    1919#include <pablo/optimizers/pablo_simplifier.hpp>
     20#include <pablo/optimizers/pablo_codesinking.hpp>
    2021#include "UCD/precompiled_gc.h"
    2122#include "UCD/precompiled_sc.h"
     
    4849static cl::opt<bool> PrintOptimizedREcode("print-pablo", cl::init(false), cl::desc("print final optimized Pablo code"), cl::cat(dPabloDumpOptions));
    4950
     51
     52cl::OptionCategory cPabloOptimizationsOptions("Pablo Optimizations",
     53                                              "These options enable optional Pablo optimization passes. (Disabled by default.)");
     54
     55static cl::opt<bool> PabloSinkingPass("sinking", cl::init(false),
     56                                      cl::desc("Moves all instructions into the innermost legal If-scope so that they are only executed when needed."),
     57                                      cl::cat(cPabloOptimizationsOptions));
    5058
    5159using namespace re;
     
    141149    // Scan through the pablo code and perform DCE and CSE
    142150    Simplifier::optimize(main);
    143 
     151    if (PabloSinkingPass) {
     152        CodeSinking::optimize(main);
     153    }
    144154    if (PrintOptimizedREcode) {
    145155      //Print to the terminal the AST that was generated by the pararallel bit-stream compiler.
Note: See TracChangeset for help on using the changeset viewer.