Ignore:
Timestamp:
Nov 5, 2015, 4:41:37 PM (4 years ago)
Author:
nmedfort
Message:

Back up check in. Memory leaks should be fixed.

File:
1 edited

Legend:

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

    r4854 r4860  
    1616#include <pablo/analysis/pabloverifier.hpp>
    1717#include <pablo/optimizers/pablo_simplifier.hpp>
    18 #include <pablo/optimizers/pablo_codesinking.hpp>
     18#include <pablo/optimizers/codemotionpass.h>
    1919#ifdef ENABLE_MULTIPLEXING
    2020#include <pablo/optimizers/pablo_bddminimization.h>
     
    246246    std::cerr << name << std::endl;
    247247    #endif
    248     PabloFunction * function = PabloFunction::Create(std::move(name), 8, 1);
     248    PabloFunction * pbFunction = PabloFunction::Create(std::move(name), 8, 1);
    249249    Encoding encoding(Encoding::Type::UTF_8, 8);
    250     CC_Compiler ccCompiler(*function, encoding);
     250    CC_Compiler ccCompiler(*pbFunction, encoding);
    251251    UCDCompiler ucdCompiler(ccCompiler);
    252     PabloBuilder builder(function->getEntryBlock());
     252    PabloBuilder builder(pbFunction->getEntryBlock());
    253253    // Build the unicode set function
    254254    PabloAST * result = nullptr;
     
    260260        throw std::runtime_error("Unknown if hierarchy strategy!");
    261261    }
    262     function->setResult(0, builder.createAssign("matches", result));
     262    pbFunction->setResult(0, builder.createAssign("matches", result));
    263263    // Optimize it at the pablo level
    264     PabloVerifier::verify(*function, "creation");
    265     Simplifier::optimize(*function);
    266     CodeMotionPass::optimize(*function);
     264    PabloVerifier::verify(*pbFunction, "creation");
     265    Simplifier::optimize(*pbFunction);
     266    CodeMotionPass::optimize(*pbFunction);
    267267    #ifdef ENABLE_MULTIPLEXING
    268268    BDDMinimizationPass::optimize(*function);
     
    287287    #endif
    288288    if (EnableReassociation) {
    289         BooleanReassociationPass::optimize(*function);       
     289        BooleanReassociationPass::optimize(*pbFunction);
    290290    }
    291291
    292292    // Now compile the function ...
    293     llvm::Function * func = pc.compile(function, module);
    294     releaseSlabAllocatorMemory();
     293    llvm::Function * func = pc.compile(pbFunction, module);
    295294
    296295    if (LongestDependenceChainFile) {
    297         const auto pablo_metrix = computePabloDependencyChainMetrics(function);
     296        const auto pablo_metrix = computePabloDependencyChainMetrics(pbFunction);
    298297        (*LongestDependenceChainFile) << ',' << pablo_metrix.first << ',' << pablo_metrix.second;
    299298        const auto llvm_metrix = computeLLVMDependencyChainMetrics(func);
     
    301300    }
    302301
     302    delete pbFunction;
    303303}
    304304
Note: See TracChangeset for help on using the changeset viewer.