Changeset 5230


Ignore:
Timestamp:
Dec 19, 2016, 2:39:35 PM (2 years ago)
Author:
nmedfort
Message:

Multi-threading support for PabloAST / PabloCompiler?. Requires unique LLVM Context / Module for each thread.

Location:
icGREP/icgrep-devel/icgrep
Files:
1 added
57 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/IDISA/idisa_builder.cpp

    r5227 r5230  
    575575}
    576576
    577 }
     577Type * IDISA_Builder::getStreamTy(const uint64_t FieldWidth) {
     578    const auto f = mStreamTypes.find(FieldWidth);
     579    if (LLVM_LIKELY(f != mStreamTypes.end())) {
     580        return f->second;
     581    } else {
     582        StreamType * const T = new StreamType(getContext(), FieldWidth);
     583        mStreamTypes.emplace(FieldWidth, T);
     584        return T;
     585    }
     586}
     587
     588}
  • icGREP/icgrep-devel/icgrep/IDISA/idisa_builder.h

    r5229 r5230  
    1515#include <llvm/ADT/Triple.h>
    1616#include <IDISA/types/streamtype.h>
     17#include <boost/container/flat_map.hpp>
    1718
    1819using namespace llvm;
     
    2122
    2223class IDISA_Builder : public IRBuilder<> {
     24
     25    using StreamTypes = boost::container::flat_map<unsigned, StreamType *>;
     26
    2327public:
    2428
     
    168172
    169173    inline Type * getStreamSetTy(const uint64_t NumElements = 1, const uint64_t FieldWidth = 1) {
    170         return ArrayType::get(StreamType::get(getContext(), FieldWidth), NumElements);
    171     }
    172    
    173     inline Type * getStreamTy(const uint64_t FieldWidth = 1) {
    174         return StreamType::get(getContext(), FieldWidth);
    175     }
    176    
     174        return ArrayType::get(getStreamTy(FieldWidth), NumElements);
     175    }
     176   
     177    Type * getStreamTy(const uint64_t FieldWidth = 1);
     178
    177179    inline llvm::AllocaInst * CreateCacheAlignedAlloca(llvm::Type * Ty, llvm::Value * ArraySize = nullptr) {
    178180        llvm::AllocaInst * instr = CreateAlloca(Ty, ArraySize);
     
    196198    Constant *          mPrintRegisterFunction;
    197199   
     200    StreamTypes         mStreamTypes;
    198201};
    199202
  • icGREP/icgrep-devel/icgrep/IDISA/idisa_nvptx_builder.cpp

    r5192 r5230  
    102102
    103103void IDISA_NVPTX20_Builder::CreateBuiltinFunctions(){   
    104     Type * const voidTy = Type::getVoidTy(mMod->getContext());
     104    Type * const voidTy = getVoidTy();
    105105    Type * const int32ty = getInt32Ty();
    106106    barrierFunc = cast<Function>(mMod->getOrInsertFunction("llvm.nvvm.barrier0", voidTy, nullptr));
  • icGREP/icgrep-devel/icgrep/IDISA/types/streamtype.h

    r5229 r5230  
    1010
    1111class StreamType : public llvm::Type {
    12 
    13     StreamType(llvm::LLVMContext & ctx, unsigned FieldWidth);
    14 
     12    friend class IDISA_Builder;
    1513public:
    16 
    1714    enum {
    1815        StreamTyId = VectorTyID + 1
    1916    };
    2017
    21     static StreamType * get(llvm::LLVMContext & ctx, unsigned FieldWidth);
    22 
    2318    unsigned getFieldWidth() const {
    2419        return mFieldWidth;
    25     }
    26 
    27     StreamType * getStreamElementType() const {
    28         return get(getContext(), mFieldWidth);
    2920    }
    3021
     
    3829        return false;
    3930    }
     31protected:
     32    StreamType(llvm::LLVMContext & ctx, unsigned FieldWidth)
     33    : llvm::Type(ctx, (Type::TypeID)(StreamTyId))
     34    , mFieldWidth(FieldWidth) {
     35    }
    4036private:
    4137    unsigned mFieldWidth;
  • icGREP/icgrep-devel/icgrep/array-test.cpp

    r5227 r5230  
    3333#include <pablo/pablo_compiler.h>
    3434#include <pablo/pablo_toolchain.h>
    35 #include <pablo/printer_pablos.h>
     35
     36#include <kernels/stdout_kernel.h>
    3637
    3738#include <llvm/Support/raw_os_ostream.h>
     39
     40#include <pthread.h>
    3841
    3942using namespace pablo;
     
    6972Function * pipeline(IDISA::IDISA_Builder * iBuilder, const unsigned count = 10) {
    7073
    71     PabloKernel main(iBuilder, "wc");
     74    PabloKernel main(iBuilder, "at");
    7275    generate(&main, count);
    7376
    74     ExternalFileBuffer input(iBuilder, iBuilder->getStreamSetTy(count));
     77    SingleBlockBuffer input(iBuilder, iBuilder->getStreamSetTy(count));
    7578
    7679    SingleBlockBuffer output(iBuilder, iBuilder->getStreamSetTy(count));
     
    7881    main.generateKernel({&input}, {&output});
    7982
    80     return nullptr;
     83    Module * const mod = iBuilder->getModule();
     84
     85    Function * const f = cast<Function>(mod->getOrInsertFunction("main", iBuilder->getVoidTy(), nullptr));
     86    f->setCallingConv(CallingConv::C);
     87
     88    iBuilder->SetInsertPoint(BasicBlock::Create(mod->getContext(), "entry", f, 0));
     89    input.allocateBuffer();
     90    output.allocateBuffer();
     91    generatePipelineLoop(iBuilder, {&main});
     92    iBuilder->CreateRetVoid();
     93
     94    return f;
    8195}
    8296
     97typedef void (*AtFunctionType)();
    8398
    84 static ExecutionEngine * wcEngine = nullptr;
    85 
    86 void * arrayTest() {
    87     Module * M = new Module("wc", getGlobalContext());
     99void * arrayTest(void *) {
     100    LLVMContext ctx;
     101    Module * M = new Module("at", ctx);
    88102    IDISA::IDISA_Builder * idb = IDISA::GetIDISA_Builder(M);
    89103
     
    92106    verifyModule(*M, &dbgs());
    93107
    94     wcEngine = JIT_to_ExecutionEngine(M);
     108    ExecutionEngine * wcEngine = JIT_to_ExecutionEngine(M);
    95109
    96110    wcEngine->finalizeObject();
    97111
    98112    delete idb;
    99 //    return wcEngine->getPointerToFunction(main_IR);
    100113
    101     return nullptr;
     114    return wcEngine->getPointerToFunction(main_IR);
    102115}
    103116
     
    106119    cl::ParseCommandLineOptions(argc, argv);
    107120
    108     arrayTest();
     121    pthread_t t1, t2;
     122
     123    pthread_create(&t1, nullptr, arrayTest, nullptr);
     124
     125    pthread_create(&t2, nullptr, arrayTest, nullptr);
     126
     127    void * r1, * r2;
     128
     129    pthread_join(t1, &r1);
     130
     131    pthread_join(t2, &r2);
    109132
    110133    return 0;
  • icGREP/icgrep-devel/icgrep/cc/cc_compiler.cpp

    r5217 r5230  
    1818#include <pablo/codegenstate.h>
    1919#include <pablo/builder.hpp>
    20 #include <pablo/prototype.h>
    2120#include <pablo/pablo_kernel.h>
    2221#include <stdexcept>
  • icGREP/icgrep-devel/icgrep/editd/editd.cpp

    r5223 r5230  
    2525#include <re/re_cc.h>
    2626#include <cc/cc_compiler.h>
    27 #include <pablo/prototype.h>
    2827#include <pablo/pablo_compiler.h>
    2928#include <pablo/pablo_kernel.h>
     
    230229
    231230    Type * const size_ty = iBuilder->getSizeTy();
    232     Type * const voidTy = Type::getVoidTy(mMod->getContext());
     231    Type * const voidTy = iBuilder->getVoidTy();
    233232    Type * const inputType = PointerType::get(ArrayType::get(ArrayType::get(iBuilder->getBitBlockType(), 8), 1), 0);
    234233   
     
    284283    ExternalFileBuffer CCResults(iBuilder, iBuilder->getStreamSetTy(4));
    285284
    286     s2pKernel  s2pk(iBuilder);
     285    S2PKernel  s2pk(iBuilder);
    287286    std::unique_ptr<Module> s2pM = s2pk.createKernelModule({&ByteStream}, {&BasisBits});
    288287
     
    297296
    298297    Type * const size_ty = iBuilder->getSizeTy();
    299     Type * const voidTy = Type::getVoidTy(mMod->getContext());
     298    Type * const voidTy = iBuilder->getVoidTy();
    300299    Type * const inputType = PointerType::get(ArrayType::get(ArrayType::get(mBitBlockType, 8), 1), 0);
    301300    Type * const outputType = PointerType::get(ArrayType::get(mBitBlockType, 4), 0);
  • icGREP/icgrep-devel/icgrep/editd/editdscan_kernel.cpp

    r5220 r5230  
    5858
    5959    Type * T = iBuilder->getIntNTy(mScanwordBitWidth);
    60     LLVMContext & ctxt = m->getContext();
    6160
    62     Function * scanFunc = cast<Function>(m->getOrInsertFunction("scan_word", Type::getVoidTy(ctxt), T, iBuilder->getInt32Ty(), T, nullptr));
     61    Function * scanFunc = cast<Function>(m->getOrInsertFunction("scan_word", iBuilder->getVoidTy(), T, iBuilder->getInt32Ty(), T, nullptr));
    6362    scanFunc->setCallingConv(CallingConv::C);
    6463    Function::arg_iterator args = scanFunc->arg_begin();
     
    7170    basePos->setName("basePos");
    7271
    73     Constant * matchProcessor = m->getOrInsertFunction("wrapped_report_pos", Type::getVoidTy(ctxt), T, iBuilder->getInt32Ty(), nullptr);
     72    Constant * matchProcessor = m->getOrInsertFunction("wrapped_report_pos", iBuilder->getVoidTy(), T, iBuilder->getInt32Ty(), nullptr);
    7473
    7574    BasicBlock * entryBlock = BasicBlock::Create(m->getContext(), "entry", scanFunc, 0);
  • icGREP/icgrep-devel/icgrep/editd/pattern_compiler.cpp

    r5217 r5230  
    2020#include <re/re_analysis.h>
    2121#include <pablo/codegenstate.h>
    22 #include <pablo/prototype.h>
    2322
    2423#include <assert.h>
  • icGREP/icgrep-devel/icgrep/generate_predefined_ucd_functions.cpp

    r5217 r5230  
    1111#include <pablo/pablo_compiler.h>
    1212#include <pablo/builder.hpp>
    13 #include <pablo/prototype.h>
    1413#include <llvm/Support/CommandLine.h>
    1514#include <utf_encoding.h>
  • icGREP/icgrep-devel/icgrep/grep_engine.cpp

    r5227 r5230  
    3333#include <kernels/pipeline.h>
    3434
    35 #include <pablo/prototype.h>
    3635#include <pablo/pablo_kernel.h>
    3736#include <pablo/pablo_toolchain.h>
     
    330329    CircularBuffer BasisBits(iBuilder, iBuilder->getStreamSetTy(8, 1), segmentSize * bufferSegments);
    331330
    332     kernel::s2pKernel  s2pk(iBuilder);
     331    kernel::S2PKernel  s2pk(iBuilder);
    333332    s2pk.generateKernel({&ByteStream}, {&BasisBits});
    334333   
  • icGREP/icgrep-devel/icgrep/icgrep-devel.files

    r5227 r5230  
    342342kernels/type/streamtype.cpp
    343343kernels/type/streamtype.h
    344 IDISA/types/streamtype.cpp
    345344IDISA/types/streamtype.h
    346345editd/pattern_compiler.cpp
     
    367366editd/pattern_compiler.cpp
    368367editd/pattern_compiler.h
    369 IDISA/types/streamtype.cpp
    370368IDISA/types/streamtype.h
    371369IDISA/CudaDriver.h
     
    573571utf8_encoder.h
    574572wc.cpp
     573IDISA/types/streamtype.cpp
     574IDISA/types/streamtype.cpp
  • icGREP/icgrep-devel/icgrep/icgrep.cpp

    r5218 r5230  
    369369    grepEngine.grepCodeGen(module_name, re_ast, CountOnly, UTF_16);
    370370
    371     releaseSlabAllocatorMemory();
    372    
    373371    allFiles = getFullFileList(inputFiles);
    374372   
  • icGREP/icgrep-devel/icgrep/kernels/kernel.cpp

    r5227 r5230  
    427427Function * KernelBuilder::generateThreadFunction(std::string name){
    428428    Module * m = iBuilder->getModule();
    429     Type * const voidTy = Type::getVoidTy(m->getContext());
     429    Type * const voidTy = iBuilder->getVoidTy();
    430430    Type * const voidPtrTy = iBuilder->getVoidPtrTy();
    431431    Type * const int8PtrTy = iBuilder->getInt8PtrTy();
  • icGREP/icgrep-devel/icgrep/kernels/s2p_kernel.cpp

    r5229 r5230  
    120120#endif
    121121   
    122 void s2pKernel::generateFinalBlockMethod() {
     122void S2PKernel::generateFinalBlockMethod() {
    123123    /* Prepare the s2p final block function:
    124124     assumption: if remaining bytes is greater than 0, it is safe to read a full block of bytes.
     
    161161
    162162   
    163 void s2pKernel::generateDoBlockLogic(Value * self, Value * blockNo) {
     163void S2PKernel::generateDoBlockLogic(Value * self, Value * blockNo) {
    164164
    165165    Value * byteStream = getStreamSetBlockPtr(self, "byteStream", blockNo);
     
    181181}
    182182   
    183 void s2pKernel::generateDoBlockMethod() {
     183void S2PKernel::generateDoBlockMethod() {
    184184    auto savePoint = iBuilder->saveIP();
    185185
  • icGREP/icgrep-devel/icgrep/kernels/s2p_kernel.h

    r5217 r5230  
    2222
    2323
    24 class s2pKernel : public KernelBuilder {
     24class S2PKernel : public KernelBuilder {
    2525public:
    2626   
    27     s2pKernel(IDISA::IDISA_Builder * iBuilder) :
     27    S2PKernel(IDISA::IDISA_Builder * iBuilder) :
    2828    KernelBuilder(iBuilder, "s2p",
    2929                  {Binding{iBuilder->getStreamSetTy(1, 8), "byteStream"}},
  • icGREP/icgrep-devel/icgrep/kernels/scanmatchgen.cpp

    r5217 r5230  
    122122    switch (mGrepType) {
    123123        case GrepType::Normal:
    124             matchProcessor = m->getOrInsertFunction("wrapped_report_match", Type::getVoidTy(ctxt), T, T, T, S, T, T, nullptr);
     124            matchProcessor = m->getOrInsertFunction("wrapped_report_match", iBuilder->getVoidTy(), T, T, T, S, T, T, nullptr);
    125125            break;
    126126        case GrepType::NameExpression:
    127             matchProcessor = m->getOrInsertFunction("insert_codepoints", Type::getVoidTy(ctxt), T, T, T, S, nullptr);
     127            matchProcessor = m->getOrInsertFunction("insert_codepoints", iBuilder->getVoidTy(), T, T, T, S, nullptr);
    128128            break;
    129129        case GrepType::PropertyValue:
    130             matchProcessor = m->getOrInsertFunction("insert_property_values", Type::getVoidTy(ctxt), T, T, T, S, nullptr);
     130            matchProcessor = m->getOrInsertFunction("insert_property_values", iBuilder->getVoidTy(), T, T, T, S, nullptr);
    131131            break;
    132132        default: llvm_unreachable("unknown grep type");
  • icGREP/icgrep-devel/icgrep/kernels/stdout_kernel.cpp

    r5224 r5230  
    2424// The doBlock method is deprecated.   But in case it is used, just call doSegment with
    2525// 1 as the number of blocks to do.
    26 void stdOutKernel::generateDoBlockMethod() {
     26void StdOutKernel::generateDoBlockMethod() {
    2727    auto savePoint = iBuilder->saveIP();
    2828    Module * m = iBuilder->getModule();
     
    3838// Rather than using doBlock logic to write one block at a time, this custom
    3939// doSegment method, writes the entire segment with a single write call.
    40 void stdOutKernel::generateDoSegmentMethod() {
     40void StdOutKernel::generateDoSegmentMethod() {
    4141    auto savePoint = iBuilder->saveIP();
    4242    Module * m = iBuilder->getModule();
     
    9494}
    9595
    96 void stdOutKernel::generateFinalBlockMethod() {
     96void StdOutKernel::generateFinalBlockMethod() {
    9797    auto savePoint = iBuilder->saveIP();
    9898    Module * m = iBuilder->getModule();
  • icGREP/icgrep-devel/icgrep/kernels/stdout_kernel.h

    r5217 r5230  
    1414namespace kernel {
    1515
    16 class stdOutKernel : public KernelBuilder {
     16class StdOutKernel : public KernelBuilder {
    1717public:
    18     stdOutKernel(IDISA::IDISA_Builder * iBuilder, unsigned codeUnitWidth) :
     18    StdOutKernel(IDISA::IDISA_Builder * iBuilder, unsigned codeUnitWidth) :
    1919    KernelBuilder(iBuilder, "stdout",
    2020                  {Binding{iBuilder->getStreamSetTy(1, codeUnitWidth), "codeUnitBuffer"}}, {}, {}, {}, {}),
  • icGREP/icgrep-devel/icgrep/kernels/symboltablepipeline.cpp

    r5217 r5230  
    1313#include <kernels/instance.h>
    1414
    15 #include <pablo/prototype.h>
    1615#include <pablo/pablo_compiler.h>
    1716#include <pablo/analysis/pabloverifier.hpp>
     
    638637    delete sorting;
    639638
    640     releaseSlabAllocatorMemory();
    641 
    642639    generateGatherKernel(mGatherKernel, endpoints, 64);
    643640}
     
    648645
    649646    Type * inputType = PointerType::get(ArrayType::get(StructType::get(mMod->getContext(), std::vector<Type *>({ArrayType::get(mBitBlockType, 8)})), 1), 0);
    650     Function * const main = cast<Function>(mMod->getOrInsertFunction("Main", Type::getVoidTy(mMod->getContext()), inputType, intType, nullptr));
     647    Function * const main = cast<Function>(mMod->getOrInsertFunction("Main", iBuilder->getVoidTy(), inputType, intType, nullptr));
    651648    main->setCallingConv(CallingConv::C);
    652649    Function::arg_iterator args = main->arg_begin();
  • icGREP/icgrep-devel/icgrep/pablo/arithmetic.h

    r5227 r5230  
    3535    virtual ~Operator() { }
    3636protected:
    37     Operator(const ClassTypeId typeId, Type * const type, PabloAST * const expr1, PabloAST * const expr2)
    38     : PabloAST(typeId, type, nullptr)
     37    Operator(const ClassTypeId typeId, Type * const type, PabloAST * const expr1, PabloAST * const expr2, Allocator & allocator)
     38    : PabloAST(typeId, type, nullptr, allocator)
    3939    , mLH(expr1)
    4040    , mRH(expr2) {
     
    5555    } \
    5656protected: \
    57     Name(Type * const type, PabloAST * const expr1, PabloAST * const expr2) \
    58     : Operator(ClassTypeId::Name, type, expr1, expr2) { \
     57    Name(Type * const type, PabloAST * const expr1, PabloAST * const expr2, Allocator & allocator) \
     58    : Operator(ClassTypeId::Name, type, expr1, expr2, allocator) { \
    5959    } \
    6060};
  • icGREP/icgrep-devel/icgrep/pablo/boolean.h

    r5217 r5230  
    1717    virtual ~And() { }
    1818protected:
    19     And(Type * const type, PabloAST * expr1, PabloAST * expr2, const String * name)
    20     : Variadic(ClassTypeId::And, type, {expr1, expr2}, name)
     19    And(Type * const type, PabloAST * expr1, PabloAST * expr2, const String * name, Allocator & allocator)
     20    : Variadic(ClassTypeId::And, type, {expr1, expr2}, name, allocator)
    2121    {
    2222
    2323    }
    24     And(Type * const type, const unsigned reserved, const String * name)
    25     : Variadic(ClassTypeId::And, type, reserved, name)
     24    And(Type * const type, const unsigned reserved, const String * name, Allocator & allocator)
     25    : Variadic(ClassTypeId::And, type, reserved, name, allocator)
    2626    {
    2727
    2828    }
    2929    template<typename iterator>
    30     And(Type * const type, iterator begin, iterator end, const String * name)
    31     : Variadic(ClassTypeId::And, type, begin, end, name) {
     30    And(Type * const type, iterator begin, iterator end, const String * name, Allocator & allocator)
     31    : Variadic(ClassTypeId::And, type, begin, end, name, allocator) {
    3232
    3333    }
     
    4545    virtual ~Or() { }
    4646protected:
    47     Or(Type * const type, PabloAST * expr1, PabloAST * expr2, const String * name)
    48     : Variadic(ClassTypeId::Or, type, {expr1, expr2}, name)
     47    Or(Type * const type, PabloAST * expr1, PabloAST * expr2, const String * name, Allocator & allocator)
     48    : Variadic(ClassTypeId::Or, type, {expr1, expr2}, name, allocator)
    4949    {
    5050
    5151    }
    52     Or(Type * const type, const unsigned reserved, const String * name)
    53     : Variadic(ClassTypeId::Or, type, reserved, name)
     52    Or(Type * const type, const unsigned reserved, const String * name, Allocator & allocator)
     53    : Variadic(ClassTypeId::Or, type, reserved, name, allocator)
    5454    {
    5555
    5656    }
    5757    template<typename iterator>
    58     Or(Type * const type, iterator begin, iterator end, const String * name)
    59     : Variadic(ClassTypeId::Or, type, begin, end, name) {
     58    Or(Type * const type, iterator begin, iterator end, const String * name, Allocator & allocator)
     59    : Variadic(ClassTypeId::Or, type, begin, end, name, allocator) {
    6060
    6161    }
     
    7272    }
    7373protected:
    74     Xor(Type * const type, PabloAST * expr1, PabloAST * expr2, const String * name)
    75     : Variadic(ClassTypeId::Xor, type, {expr1, expr2}, name)
     74    Xor(Type * const type, PabloAST * expr1, PabloAST * expr2, const String * name, Allocator & allocator)
     75    : Variadic(ClassTypeId::Xor, type, {expr1, expr2}, name, allocator)
    7676    {
    7777
    7878    }
    79     Xor(Type * const type, const unsigned reserved, const String * name)
    80     : Variadic(ClassTypeId::Xor, type, reserved, name)
     79    Xor(Type * const type, const unsigned reserved, const String * name, Allocator & allocator)
     80    : Variadic(ClassTypeId::Xor, type, reserved, name, allocator)
    8181    {
    8282
    8383    }
    8484    template<typename iterator>
    85     Xor(Type * const type, iterator begin, iterator end, const String * name)
    86     : Variadic(ClassTypeId::Xor, type, begin, end, name) {
     85    Xor(Type * const type, iterator begin, iterator end, const String * name, Allocator & allocator)
     86    : Variadic(ClassTypeId::Xor, type, begin, end, name, allocator) {
    8787
    8888    }
     
    104104    }
    105105protected:
    106     Not(PabloAST * expr, const String * name)
    107     : Statement(ClassTypeId::Not, expr->getType(), {expr}, name)
     106    Not(PabloAST * expr, const String * name, Allocator & allocator)
     107    : Statement(ClassTypeId::Not, expr->getType(), {expr}, name, allocator)
    108108    {
    109109
     
    132132    }
    133133protected:
    134     Sel(PabloAST * condExpr, PabloAST * trueExpr, PabloAST * falseExpr, const String * name)
    135     : Statement(ClassTypeId::Sel, trueExpr->getType(), {condExpr, trueExpr, falseExpr}, name) {
     134    Sel(PabloAST * condExpr, PabloAST * trueExpr, PabloAST * falseExpr, const String * name, Allocator & allocator)
     135    : Statement(ClassTypeId::Sel, trueExpr->getType(), {condExpr, trueExpr, falseExpr}, name, allocator) {
    136136
    137137    }
  • icGREP/icgrep-devel/icgrep/pablo/branch.cpp

    r5227 r5230  
    55namespace pablo {
    66
    7 Branch::Branch(const ClassTypeId typeId, PabloAST * condition, PabloBlock * body)
    8 : Statement(typeId, nullptr, {condition}, nullptr)
     7Branch::Branch(const ClassTypeId typeId, PabloAST * condition, PabloBlock * body, Allocator &allocator)
     8: Statement(typeId, nullptr, {condition}, nullptr, allocator)
    99, mBody(body) {
    1010
  • icGREP/icgrep-devel/icgrep/pablo/branch.h

    r5227 r5230  
    4242    EscapedVars getEscaped() const;
    4343protected:
    44     Branch(const ClassTypeId typeId, PabloAST * condition, PabloBlock * body);
     44    Branch(const ClassTypeId typeId, PabloAST * condition, PabloBlock * body, Allocator & allocator);
    4545protected:
    4646    PabloBlock *            mBody;
     
    5656    }
    5757protected:
    58     If(PabloAST * condition, PabloBlock * body)
    59     : Branch(ClassTypeId::If, condition, body) {
     58    If(PabloAST * condition, PabloBlock * body, Allocator & allocator)
     59    : Branch(ClassTypeId::If, condition, body, allocator) {
    6060
    6161    }
     
    7171    }
    7272protected:
    73     While(PabloAST * condition, PabloBlock * body)
    74     : Branch(ClassTypeId::While, condition, body) {
     73    While(PabloAST * condition, PabloBlock * body, Allocator & allocator)
     74    : Branch(ClassTypeId::While, condition, body, allocator) {
    7575
    7676    }
  • icGREP/icgrep-devel/icgrep/pablo/builder.hpp

    r5229 r5230  
    5454
    5555    inline static PabloBuilder Create(PabloBuilder & builder) noexcept {
    56         return PabloBuilder(PabloBlock::Create(builder.getPabloBlock()), builder);
     56        return PabloBuilder(PabloBlock::Create(builder.getPabloBlock()->getParent()), builder);
    5757    }
    5858
  • icGREP/icgrep-devel/icgrep/pablo/codegenstate.cpp

    r5229 r5230  
    3636Call * PabloBlock::createCall(PabloAST * prototype, const std::vector<PabloAST *> &) {
    3737    assert (prototype);
    38     return insertAtInsertionPoint(new Call(prototype));
     38    return insertAtInsertionPoint(new (mAllocator) Call(prototype, mAllocator));
    3939}
    4040
    4141Count * PabloBlock::createCount(PabloAST * expr) {
    4242    Type * type = getParent()->getBuilder()->getSizeTy();
    43     return insertAtInsertionPoint(new Count(expr, makeName("count"), type));
     43    return insertAtInsertionPoint(new (mAllocator) Count(expr, makeName("count"), type, mAllocator));
    4444}
    4545
    4646Count * PabloBlock::createCount(PabloAST * const expr, const std::string & prefix)  {
    4747    Type * type = getParent()->getBuilder()->getSizeTy();
    48     return insertAtInsertionPoint(new Count(expr, makeName(prefix), type));
     48    return insertAtInsertionPoint(new (mAllocator) Count(expr, makeName(prefix), type, mAllocator));
    4949}
    5050
     
    5454        name = makeName("not");
    5555    }
    56     return insertAtInsertionPoint(new Not(expr, name));
     56    return insertAtInsertionPoint(new (mAllocator) Not(expr, name, mAllocator));
    5757}
    5858
     
    7272        name = makeName("inFile");
    7373    }
    74     return insertAtInsertionPoint(new InFile(expr, name));
     74    return insertAtInsertionPoint(new (mAllocator) InFile(expr, name, mAllocator));
    7575}
    7676
     
    8080        name = makeName("atEOF");
    8181    }
    82     return insertAtInsertionPoint(new AtEOF(expr, name));
     82    return insertAtInsertionPoint(new (mAllocator) AtEOF(expr, name, mAllocator));
    8383}
    8484   
     
    9090        name = makeName("advance");
    9191    }
    92     return insertAtInsertionPoint(new Advance(expr, shiftAmount, name));
     92    return insertAtInsertionPoint(new (mAllocator) Advance(expr, shiftAmount, name, mAllocator));
    9393}
    9494
     
    9797        name = makeName("lookahead");
    9898    }
    99     return insertAtInsertionPoint(new Lookahead(expr, shiftAmount, name));
     99    return insertAtInsertionPoint(new (mAllocator) Lookahead(expr, shiftAmount, name, mAllocator));
    100100}
    101101
     
    112112    }
    113113    Type * type = array->getType();
    114     if (LLVM_LIKELY(isa<StreamType>(type))) {
    115         type = cast<StreamType>(type)->getStreamElementType();
    116     } else if (LLVM_LIKELY(isa<ArrayType>(type))) {
     114    if (LLVM_LIKELY(isa<ArrayType>(type))) {
    117115        type = cast<ArrayType>(type)->getArrayElementType();
    118116    } else {
     
    124122        throw std::runtime_error(out.str());
    125123    }
    126     return insertAtInsertionPoint(new Extract(array, index, name, type));
     124    return insertAtInsertionPoint(new (mAllocator) Extract(array, index, name, type, mAllocator));
    127125}
    128126
     
    132130        name = makeName("and");
    133131    }
    134     return insertAtInsertionPoint(new And(expr1->getType(), expr1, expr2, name));
     132    return insertAtInsertionPoint(new (mAllocator) And(expr1->getType(), expr1, expr2, name, mAllocator));
    135133}
    136134
     
    139137        name = makeName("and");
    140138    }
    141     return insertAtInsertionPoint(new And(type, reserved, name));
     139    return insertAtInsertionPoint(new (mAllocator) And(type, reserved, name, mAllocator));
    142140}
    143141
     
    147145        name = makeName("or");
    148146    }
    149     return insertAtInsertionPoint(new Or(expr1->getType(), expr1, expr2, name));
     147    return insertAtInsertionPoint(new (mAllocator) Or(expr1->getType(), expr1, expr2, name, mAllocator));
    150148}
    151149
     
    154152        name = makeName("or");
    155153    }
    156     return insertAtInsertionPoint(new Or(type, reserved, name));
     154    return insertAtInsertionPoint(new (mAllocator) Or(type, reserved, name, mAllocator));
    157155}
    158156
     
    162160        name = makeName("xor");
    163161    }
    164     return insertAtInsertionPoint(new Xor(expr1->getType(), expr1, expr2, name));
     162    return insertAtInsertionPoint(new (mAllocator) Xor(expr1->getType(), expr1, expr2, name, mAllocator));
    165163}
    166164
     
    169167        name = makeName("xor");
    170168    }
    171     return insertAtInsertionPoint(new Xor(type, reserved, name));
     169    return insertAtInsertionPoint(new (mAllocator) Xor(type, reserved, name, mAllocator));
    172170}
    173171
    174172Add * PabloBlock::createAdd(PabloAST * expr1, PabloAST * expr2) {
    175173    CHECK_SAME_TYPE(expr1, expr2);
    176     return new Add(expr1->getType(), expr1, expr2);
     174    return new (mAllocator) Add(expr1->getType(), expr1, expr2, mAllocator);
    177175}
    178176
    179177Subtract * PabloBlock::createSubtract(PabloAST * expr1, PabloAST * expr2) {
    180178    CHECK_SAME_TYPE(expr1, expr2);
    181     return new Subtract(expr1->getType(), expr1, expr2);
     179    return new (mAllocator) Subtract(expr1->getType(), expr1, expr2, mAllocator);
    182180}
    183181
    184182LessThan * PabloBlock::createLessThan(PabloAST * expr1, PabloAST * expr2) {
    185183    CHECK_SAME_TYPE(expr1, expr2);
    186     return new LessThan(getParent()->getBuilder()->getInt1Ty(), expr1, expr2);
     184    return new (mAllocator) LessThan(getParent()->getBuilder()->getInt1Ty(), expr1, expr2, mAllocator);
    187185}
    188186
     
    241239    }
    242240
    243     return insertAtInsertionPoint(new Assign(var, value));
     241    return insertAtInsertionPoint(new (mAllocator) Assign(var, value, mAllocator));
    244242}
    245243
     
    249247        name = makeName("matchstar");
    250248    }
    251     return insertAtInsertionPoint(new MatchStar(marker, charclass, name));
     249    return insertAtInsertionPoint(new (mAllocator) MatchStar(marker, charclass, name, mAllocator));
    252250}
    253251
     
    257255        name = makeName("scanthru");
    258256    }
    259     return insertAtInsertionPoint(new ScanThru(from, thru, name));
     257    return insertAtInsertionPoint(new (mAllocator) ScanThru(from, thru, name, mAllocator));
    260258}
    261259
    262260If * PabloBlock::createIf(PabloAST * condition, PabloBlock * body) {
    263261    assert (condition);
    264     If * const node = insertAtInsertionPoint(new If(condition, body));
     262    If * const node = insertAtInsertionPoint(new (mAllocator) If(condition, body, mAllocator));
    265263    body->setBranch(node);
    266264    return node;
     
    269267While * PabloBlock::createWhile(PabloAST * condition, PabloBlock * body) {
    270268    assert (condition);
    271     While * const node = insertAtInsertionPoint(new While(condition, body));
     269    While * const node = insertAtInsertionPoint(new (mAllocator) While(condition, body, mAllocator));
    272270    body->setBranch(node);
    273271    return node;
     
    281279        name = makeName("sel");
    282280    }
    283     return insertAtInsertionPoint(new Sel(condition, trueExpr, falseExpr, name));
     281    return insertAtInsertionPoint(new (mAllocator) Sel(condition, trueExpr, falseExpr, name, mAllocator));
    284282}
    285283
     
    313311        stmt = stmt->eraseFromParent(recursively);
    314312    }
    315     mAllocator.deallocate(reinterpret_cast<Allocator::pointer>(this));
    316 }
    317 
    318 }
     313}
     314
     315}
  • icGREP/icgrep-devel/icgrep/pablo/codegenstate.h

    r5229 r5230  
    6262
    6363    inline static PabloBlock * Create(PabloKernel * const parent) noexcept {
    64         return new PabloBlock(parent);
    65     }
    66 
    67     inline static PabloBlock * Create(PabloBlock * const predecessor) noexcept {
    68         return new PabloBlock(predecessor->mParent);
     64        Allocator & allocator = parent->mAllocator;
     65        return new (allocator) PabloBlock(parent, allocator);
    6966    }
    7067
     
    313310protected:
    314311
    315     explicit PabloBlock(PabloKernel * const parent) noexcept
    316     : PabloAST(PabloAST::ClassTypeId::Block, nullptr, nullptr)
     312    explicit PabloBlock(PabloKernel * const parent, Allocator & allocator) noexcept
     313    : PabloAST(PabloAST::ClassTypeId::Block, nullptr, nullptr, allocator)
    317314    , mParent(parent)
    318315    , mBranch(nullptr)
    319     , mScopeIndex(0) {
     316    , mScopeIndex(0)
     317    , mAllocator(allocator) {
    320318
    321319    }
     
    337335    Branch *                    mBranch;
    338336    unsigned                    mScopeIndex;
     337    Allocator &                 mAllocator;
    339338};
    340339
  • icGREP/icgrep-devel/icgrep/pablo/expression_map.hpp

    r5202 r5230  
    9898    friend struct ExpressionTable;
    9999
    100     using Allocator = LLVMAllocator;
     100    using Allocator = SlabAllocator<const PabloAST *>;
    101101
    102102    struct Key {
     
    105105        : mType(type)
    106106        , mArgs(1 + args.size())
    107         , mArg(allocator.Allocate<const PabloAST *>(mArgs)) {
     107        , mArg(allocator.allocate(mArgs)) {
    108108            unsigned i = 1;
    109109            mArg[0] = arg1;
     
    116116        : mType(type)
    117117        , mArgs(stmt->getNumOperands())
    118         , mArg(allocator.Allocate<const PabloAST *>(mArgs)) {
     118        , mArg(allocator.allocate(mArgs)) {
    119119            unsigned i = 0;
    120120            for (PabloAST * arg : *stmt) {
     
    170170        PabloAST * const f = find(key);
    171171        if (f) {
    172             mAllocator.Deallocate<const PabloAST *>(key.mArg);
     172            mAllocator.deallocate(key.mArg);
    173173            return f;
    174174        }
     
    182182        PabloAST * const entry = find(key);
    183183        if (entry) {
    184             mAllocator.Deallocate<const PabloAST *>(key.mArg);
     184            mAllocator.deallocate(key.mArg);
    185185            return std::make_pair(entry, false);
    186186        }
  • icGREP/icgrep-devel/icgrep/pablo/optimizers/pablo_automultiplexing.cpp

    r5217 r5230  
    11#include "pablo_automultiplexing.hpp"
    22#include <pablo/builder.hpp>
    3 #include <pablo/prototype.h>
    43#include <pablo/printer_pablos.h>
    54#include <boost/container/flat_set.hpp>
  • icGREP/icgrep-devel/icgrep/pablo/pabloAST.cpp

    r5227 r5230  
    1616
    1717namespace pablo {
    18 
    19 PabloAST::Allocator PabloAST::mAllocator;
    20 PabloAST::VectorAllocator PabloAST::mVectorAllocator;
    2118
    2219using TypeId = PabloAST::ClassTypeId;
     
    280277    }
    281278
    282     mAllocator.deallocate(reinterpret_cast<Allocator::pointer>(this));
    283279    return next;
    284280}
     
    307303    if (LLVM_UNLIKELY(mOperands == mCapacity)) {
    308304        mCapacity = std::max<unsigned>(mCapacity * 2, 2);
    309         PabloAST ** expandedOperandSpace = reinterpret_cast<PabloAST**>(mAllocator.allocate(mCapacity * sizeof(PabloAST *)));
     305        PabloAST ** expandedOperandSpace = mAllocator.allocate(mCapacity);
    310306        for (unsigned i = 0; i != mOperands; ++i) {
    311307            expandedOperandSpace[i] = mOperand[i];
    312308        }
    313         mAllocator.deallocate(reinterpret_cast<Allocator::pointer>(mOperand));
     309        mAllocator.deallocate(mOperand);
    314310        mOperand = expandedOperandSpace;
    315311    }
  • icGREP/icgrep-devel/icgrep/pablo/pabloAST.h

    r5227 r5230  
    3838public:
    3939
    40     using Allocator = SlabAllocator<u_int8_t>;
    41     using VectorAllocator = SlabAllocator<PabloAST *>;
    42     using Users = std::vector<PabloAST *, VectorAllocator>;
     40    using Allocator = SlabAllocator<PabloAST *>;
     41    using Users = std::vector<PabloAST *, Allocator>;
    4342    using user_iterator = Users::iterator;
    4443    using const_user_iterator = Users::const_iterator;
     
    149148    }
    150149
    151     void * operator new (std::size_t size) noexcept {
    152         return mAllocator.allocate(size);
    153     }
    154 
    155     void operator delete (void * ptr) {
    156         mAllocator.deallocate(static_cast<Allocator::value_type *>(ptr));
    157     }
     150    void * operator new (std::size_t size, Allocator & allocator) noexcept {
     151        return allocator.allocate<uint8_t>(size);
     152    }
     153
     154//    void operator delete (void * ptr) {
     155//        mAllocator.deallocate(static_cast<Allocator::value_type *>(ptr));
     156//    }
    158157
    159158    void print(raw_ostream & O) const;
    160159
    161160protected:
    162     inline PabloAST(const ClassTypeId id, Type * const type, const String * name)
     161    inline PabloAST(const ClassTypeId id, Type * const type, const String * name, Allocator & allocator)
    163162    : mClassTypeId(id)
    164163    , mType(type)
    165164    , mName(name)
    166     , mUsers(mVectorAllocator)
    167     {
     165    , mUsers(allocator) {
    168166
    169167    }
     
    172170    virtual ~PabloAST() {
    173171        mUsers.clear();
    174     }   
    175     static Allocator        mAllocator;
    176     static VectorAllocator  mVectorAllocator;
     172    }       
    177173private:
    178174    const ClassTypeId       mClassTypeId;
     
    239235    virtual ~Statement() {}
    240236protected:
    241     explicit Statement(const ClassTypeId id, Type * const type, std::initializer_list<PabloAST *> operands, const String * const name)
    242     : PabloAST(id, type, name)
     237    explicit Statement(const ClassTypeId id, Type * const type, std::initializer_list<PabloAST *> operands, const String * const name, Allocator & allocator)
     238    : PabloAST(id, type, name, allocator)
    243239    , mNext(nullptr)
    244240    , mPrev(nullptr)
    245241    , mParent(nullptr)
    246242    , mOperands(operands.size())
    247     , mOperand(reinterpret_cast<PabloAST**>(mAllocator.allocate(mOperands * sizeof(PabloAST *)))) {
     243    , mOperand(allocator.allocate(mOperands)) {
    248244        unsigned i = 0;
    249245        for (PabloAST * const value : operands) {
     
    254250        }
    255251    }
    256     explicit Statement(const ClassTypeId id, Type * const type, const unsigned reserved, const String * const name)
    257     : PabloAST(id, type, name)
     252    explicit Statement(const ClassTypeId id, Type * const type, const unsigned reserved, const String * const name, Allocator & allocator)
     253    : PabloAST(id, type, name, allocator)
    258254    , mNext(nullptr)
    259255    , mPrev(nullptr)
    260256    , mParent(nullptr)
    261257    , mOperands(0)
    262     , mOperand(reinterpret_cast<PabloAST**>(mAllocator.allocate(reserved * sizeof(PabloAST *)))) {
     258    , mOperand(allocator.allocate(mOperands)) {
    263259        std::memset(mOperand, 0, reserved * sizeof(PabloAST *));
    264260    }
    265261    template<typename iterator>
    266     explicit Statement(const ClassTypeId id, Type * const type, iterator begin, iterator end, const String * const name)
    267     : PabloAST(id, type, name)
     262    explicit Statement(const ClassTypeId id, Type * const type, iterator begin, iterator end, const String * const name, Allocator & allocator)
     263    : PabloAST(id, type, name, allocator)
    268264    , mNext(nullptr)
    269265    , mPrev(nullptr)
    270266    , mParent(nullptr)
    271267    , mOperands(std::distance(begin, end))
    272     , mOperand(reinterpret_cast<PabloAST**>(mAllocator.allocate(mOperands * sizeof(PabloAST *)))) {
     268    , mOperand(allocator.allocate(mOperands)) {
    273269        unsigned i = 0;
    274270        for (auto value = begin; value != end; ++value, ++i) {
     
    348344
    349345protected:
    350     explicit Variadic(const ClassTypeId id, Type * const type, std::initializer_list<PabloAST *> operands, const String * const name)
    351     : Statement(id, type, operands, name)
    352     , mCapacity(operands.size()) {
    353 
    354     }
    355     explicit Variadic(const ClassTypeId id, Type * const type, const unsigned reserved, const String * name)
    356     : Statement(id, type, reserved, name)
    357     , mCapacity(reserved) {
     346    explicit Variadic(const ClassTypeId id, Type * const type, std::initializer_list<PabloAST *> operands, const String * const name, Allocator & allocator)
     347    : Statement(id, type, operands, name, allocator)
     348    , mCapacity(operands.size())
     349    , mAllocator(allocator) {
     350
     351    }
     352    explicit Variadic(const ClassTypeId id, Type * const type, const unsigned reserved, const String * name, Allocator & allocator)
     353    : Statement(id, type, reserved, name, allocator)
     354    , mCapacity(reserved)
     355    , mAllocator(allocator) {
    358356
    359357    }
    360358    template<typename iterator>
    361     explicit Variadic(const ClassTypeId id, Type * const type, iterator begin, iterator end, const String * name)
    362     : Statement(id, type, begin, end, name)
    363     , mCapacity(std::distance(begin, end)) {
     359    explicit Variadic(const ClassTypeId id, Type * const type, iterator begin, iterator end, const String * name, Allocator & allocator)
     360    : Statement(id, type, begin, end, name, allocator)
     361    , mCapacity(std::distance(begin, end))
     362    , mAllocator(allocator) {
    364363
    365364    }
    366365private:
    367366    unsigned        mCapacity;
     367    Allocator &     mAllocator;
    368368};
    369369
  • icGREP/icgrep-devel/icgrep/pablo/pablo_kernel.cpp

    r5229 r5230  
    77#include <pablo/codegenstate.h>
    88#include <pablo/pablo_compiler.h>
    9 #include <llvm/Support/Debug.h>
     9// #include <llvm/Support/Debug.h>
    1010#include <pablo/pe_var.h>
    1111#include <llvm/IR/Verifier.h>
    1212#include <IDISA/idisa_builder.h>
    13 #include <pablo/prototype.h>
    14 #include <stack>
    1513
    1614using namespace pablo;
     
    2018
    2119Var * PabloKernel::addInput(const std::string name, Type * const type) {
    22     Var * param = new Var(mSymbolTable->make(name), type, true);
     20    Var * param = new (mAllocator) Var(mSymbolTable->make(name, iBuilder), type, mAllocator, true);
    2321    mInputs.push_back(param);
    2422    if (isa<ArrayType>(type) || isa<StreamType>(type)) {
     
    3230
    3331Var * PabloKernel::addOutput(const std::string name, Type * const type) {
    34     Var * result = new Var(mSymbolTable->make(name), type, false);
     32    Var * result = new (mAllocator) Var(mSymbolTable->make(name, iBuilder), type, mAllocator, false);
    3533    mOutputs.push_back(result);
    3634    if (isa<ArrayType>(type) || isa<StreamType>(type)) {
     
    4442
    4543Var * PabloKernel::makeVariable(PabloAST * name, Type * const type) {
    46     Var * const var = new Var(name, type);
     44    Var * const var = new (mAllocator) Var(name, type, mAllocator);
    4745    mVariables.push_back(var);
    4846    return var;
     
    5856        }
    5957    }
    60     Zeroes * value = new Zeroes(type);
     58    Zeroes * value = new (mAllocator) Zeroes(type, mAllocator);
    6159    mConstants.push_back(value);
    6260    return value;
     
    7270        }
    7371    }
    74     Ones * value = new Ones(type);
     72    Ones * value = new (mAllocator) Ones(type, mAllocator);
    7573    mConstants.push_back(value);
    7674    return value;
     
    131129: KernelBuilder(builder, kernelName, {}, {}, {}, {}, {Binding{builder->getBitBlockType(), "EOFbit"}, Binding{builder->getBitBlockType(), "EOFmask"}})
    132130, mPabloCompiler(new PabloCompiler(this))
    133 , mSymbolTable(new SymbolGenerator())
     131, mSymbolTable(new SymbolGenerator(mAllocator))
    134132, mEntryBlock(PabloBlock::Create(this))
    135133{
  • icGREP/icgrep-devel/icgrep/pablo/pablo_kernel.h

    r5217 r5230  
    99#include <kernels/kernel.h>
    1010#include <pablo/symbol_generator.h>
     11#include <util/slab_allocator.h>
    1112
    1213namespace IDISA {
     
    3334
    3435public:
     36
     37    using Allocator = PabloAST::Allocator;
    3538
    3639    PabloKernel(IDISA::IDISA_Builder * builder, const std::string & kernelName);
     
    115118
    116119    inline String * getName(const std::string & name) const {
    117         return mSymbolTable->get(name);
     120        return mSymbolTable->get(name, iBuilder);
    118121    }
    119122
    120123    inline String * makeName(const std::string & prefix) const {
    121         return mSymbolTable->make(prefix);
     124        return mSymbolTable->make(prefix, iBuilder);
    122125    }
    123126
     
    128131private:
    129132
     133    Allocator                       mAllocator;
    130134    PabloCompiler * const           mPabloCompiler;
    131135    SymbolGenerator *               mSymbolTable;
    132136    PabloBlock *                    mEntryBlock;
     137
    133138    std::vector<Var *>              mInputs;
    134139    std::vector<Var *>              mOutputs;
  • icGREP/icgrep-devel/icgrep/pablo/pablo_toolchain.cpp

    r5227 r5230  
    2020#include <pablo/optimizers/schedulingprepass.h>
    2121#endif
    22 #include <pablo/prototype.h>
    2322#include <pablo/analysis/pabloverifier.hpp>
    2423#include <pablo/printer_pablos.h>
    2524#include <llvm/Support/CommandLine.h>
    2625#include <llvm/Support/FileSystem.h>
     26#include <llvm/Support/raw_ostream.h>
    2727#ifdef PRINT_TIMING_INFORMATION
    2828#include <hrtime.h>
     
    176176    if (DebugOptions.isSet(PrintCompiledREcode)) {
    177177        //Print to the terminal the AST that was generated by the pararallel bit-stream compiler.
    178         llvm::raw_os_ostream cerr(std::cerr);
    179         cerr << "Initial Pablo AST:\n";
    180         PabloPrinter::print(kernel, cerr);
     178        errs() << "Initial Pablo AST:\n";
     179        PabloPrinter::print(kernel, errs());
    181180    }
    182181   
     
    243242    if (DebugOptions.isSet(PrintUnloweredCode)) {
    244243        //Print to the terminal the AST that was generated by the pararallel bit-stream compiler.
    245         llvm::raw_os_ostream cerr(std::cerr);
    246         cerr << "Unlowered Pablo AST:\n";
    247         PabloPrinter::print(kernel, cerr);
     244        errs() << "Unlowered Pablo AST:\n";
     245        PabloPrinter::print(kernel, errs());
    248246    }
    249247    #ifdef PRINT_TIMING_INFORMATION
     
    267265        if (PabloOutputFilename.empty()) {
    268266            //Print to the terminal the AST that was generated by the pararallel bit-stream compiler.
    269             llvm::raw_os_ostream cerr(std::cerr);
    270             cerr << "Final Pablo AST:\n";
    271             PabloPrinter::print(kernel, cerr);
     267            errs() << "Final Pablo AST:\n";
     268            PabloPrinter::print(kernel, errs());
    272269        } else {
    273270            std::error_code error;
     
    277274    }
    278275#ifdef PRINT_TIMING_INFORMATION
    279     std::cerr << "PABLO OPTIMIZATION TIME: " << (optimization_end - optimization_start) << std::endl;
    280     std::cerr << "  SIMPLIFICATION TIME: " << (simplification_end - simplification_start) << std::endl;
    281     std::cerr << "  COALESCING TIME: " << (coalescing_end - coalescing_start) << std::endl;
    282     std::cerr << "  SINKING TIME: " << (sinking_end - sinking_start) << std::endl;
    283     std::cerr << "  PRE-DISTRIBUTION TIME: " << (pre_distribution_end - pre_distribution_start) << std::endl;
    284     std::cerr << "  MULTIPLEXING TIME: " << (multiplexing_end - multiplexing_start) << std::endl;
    285     std::cerr << "  LOWERING TIME: " << (lowering_end - lowering_start) << std::endl;
    286     std::cerr << "  FLATTENIF TIME: " << (flattenif_end - flattenif_start) << std::endl;
    287     std::cerr << "  POST-DISTRIBUTION TIME: " << (post_distribution_end - post_distribution_start) << std::endl;
    288     std::cerr << "  SCHEDULING TIME: " << (scheduling_end - scheduling_start) << std::endl;
    289     std::cerr << "PABLO STATEMENTS: " << COUNT_STATEMENTS(function) << std::endl;
    290     std::cerr << "PABLO ADVANCES: " << COUNT_ADVANCES(function) << std::endl;
    291     std::cerr << "PRE-LOWERING VARIADIC DISTRIBUTION: ";
     276    errs() << "PABLO OPTIMIZATION TIME: " << (optimization_end - optimization_start) << "\n";
     277    errs() << "  SIMPLIFICATION TIME: " << (simplification_end - simplification_start) << "\n";
     278    errs() << "  COALESCING TIME: " << (coalescing_end - coalescing_start) << "\n";
     279    errs() << "  SINKING TIME: " << (sinking_end - sinking_start) << "\n";
     280    errs() << "  PRE-DISTRIBUTION TIME: " << (pre_distribution_end - pre_distribution_start) << "\n";
     281    errs() << "  MULTIPLEXING TIME: " << (multiplexing_end - multiplexing_start) << "\n";
     282    errs() << "  LOWERING TIME: " << (lowering_end - lowering_start) << "\n";
     283    errs() << "  FLATTENIF TIME: " << (flattenif_end - flattenif_start) << "\n";
     284    errs() << "  POST-DISTRIBUTION TIME: " << (post_distribution_end - post_distribution_start) << "\n";
     285    errs() << "  SCHEDULING TIME: " << (scheduling_end - scheduling_start) << "\n";
     286    errs() << "PABLO STATEMENTS: " << COUNT_STATEMENTS(function) << "\n";
     287    errs() << "PABLO ADVANCES: " << COUNT_ADVANCES(function) << "\n";
     288    errs() << "PRE-LOWERING VARIADIC DISTRIBUTION: ";
    292289    bool join = false;
    293290    for (auto dist : distribution) {
    294291        if (join) {
    295             std::cerr << ';';
    296         }
    297         std::cerr << dist.first << '|' << dist.second;
     292            errs() << ';';
     293        }
     294        errs() << dist.first << '|' << dist.second;
    298295        join = true;
    299296    }
    300     std::cerr << std::endl;
    301 #endif
    302 }
    303 
    304 }
     297    errs() << "\n";
     298#endif
     299}
     300
     301}
  • icGREP/icgrep-devel/icgrep/pablo/pe_advance.h

    r5227 r5230  
    3232    }
    3333protected:
    34     Advance(PabloAST * expr, PabloAST * shiftAmount, const String * name)
    35     : Statement(ClassTypeId::Advance, expr->getType(), {expr, shiftAmount}, name)
    36     {
     34    Advance(PabloAST * expr, PabloAST * shiftAmount, const String * name, Allocator & allocator)
     35    : Statement(ClassTypeId::Advance, expr->getType(), {expr, shiftAmount}, name, allocator) {
    3736        assert(isa<Integer>(shiftAmount));
    3837    }
  • icGREP/icgrep-devel/icgrep/pablo/pe_call.h

    r5217 r5230  
    2424        return getPrototype()->getName();
    2525    }
    26     inline void setLocalCarryIndex(const unsigned idx) {
    27         mLocalCarryIndex = idx;
    28     }
    29     inline unsigned getLocalCarryIndex() const {
    30         return mLocalCarryIndex;
    31     }
    3226protected:
    33     Call(PabloAST * prototype)
    34     : Statement(ClassTypeId::Call, nullptr, {prototype}, prototype->getName())
    35     , mLocalCarryIndex(0) {
     27    Call(PabloAST * prototype, Allocator & allocator)
     28    : Statement(ClassTypeId::Call, nullptr, {prototype}, prototype->getName(), allocator) {
    3629
    3730    }
    38 private:
    39     unsigned mLocalCarryIndex;
    4031};
    4132}
  • icGREP/icgrep-devel/icgrep/pablo/pe_constant.h

    r5202 r5230  
    2424    }
    2525protected:
    26     Constant(Type * type, const PabloAST * const value) : Constant(ClassTypeId::Ones, type), mValue(value) { }
     26    Constant(Type * type, const PabloAST * const value, Allocator & allocator)
     27    : PabloAST(ClassTypeId::Ones, type, allocators)
     28    , mValue(value) {
     29    }
    2730private:
    2831
  • icGREP/icgrep-devel/icgrep/pablo/pe_count.h

    r5217 r5230  
    2727    }
    2828protected:
    29     explicit Count(PabloAST * expr, const String * counter, Type * type)
    30     : Statement(ClassTypeId::Count, type, {expr}, counter) {
     29    explicit Count(PabloAST * expr, const String * name, Type * type, Allocator & allocator)
     30    : Statement(ClassTypeId::Count, type, {expr}, name, allocator) {
    3131
    3232    }
  • icGREP/icgrep-devel/icgrep/pablo/pe_infile.h

    r5202 r5230  
    2727    }
    2828protected:
    29     InFile(PabloAST * expr, const String * name)
    30     : Statement(ClassTypeId::InFile, expr->getType(), {expr}, name) {
     29    InFile(PabloAST * expr, const String * name, Allocator & allocator)
     30    : Statement(ClassTypeId::InFile, expr->getType(), {expr}, name, allocator) {
    3131
    3232    }
     
    4848    }
    4949protected:
    50     AtEOF(PabloAST * expr, const String * name)
    51     : Statement(ClassTypeId::AtEOF, expr->getType(), {expr}, name) {
     50    AtEOF(PabloAST * expr, const String * name, Allocator & allocator)
     51    : Statement(ClassTypeId::AtEOF, expr->getType(), {expr}, name, allocator) {
    5252
    5353    }
  • icGREP/icgrep-devel/icgrep/pablo/pe_integer.h

    r5227 r5230  
    2424    }
    2525protected:
    26     Integer(const IntTy value, Type * type) noexcept
    27     : PabloAST(ClassTypeId::Integer, type, nullptr)
     26    Integer(const IntTy value, Type * type, Allocator & allocator) noexcept
     27    : PabloAST(ClassTypeId::Integer, type, nullptr, allocator)
    2828    , mValue(value)
    2929    {
  • icGREP/icgrep-devel/icgrep/pablo/pe_lookahead.h

    r5227 r5230  
    3232    }
    3333protected:
    34     Lookahead(PabloAST * expr, PabloAST * shiftAmount, const String * name)
    35     : Statement(ClassTypeId::Lookahead, expr->getType(), {expr, shiftAmount}, name)
    36     {
     34    Lookahead(PabloAST * expr, PabloAST * shiftAmount, const String * name, Allocator & allocator)
     35    : Statement(ClassTypeId::Lookahead, expr->getType(), {expr, shiftAmount}, name, allocator) {
    3736        assert(isa<Integer>(shiftAmount));
    3837    }
  • icGREP/icgrep-devel/icgrep/pablo/pe_matchstar.h

    r5227 r5230  
    2929    virtual ~MatchStar() {}
    3030protected:
    31     MatchStar(PabloAST * marker,  PabloAST * cc, const String * name)
    32     : Statement(ClassTypeId::MatchStar, marker->getType(), {marker, cc}, name) {
    33 
     31    MatchStar(PabloAST * marker,  PabloAST * cc, const String * name, Allocator & allocator)
     32    : Statement(ClassTypeId::MatchStar, marker->getType(), {marker, cc}, name, allocator) {
    3433    }
    3534};
  • icGREP/icgrep-devel/icgrep/pablo/pe_ones.h

    r5217 r5230  
    3131    }
    3232protected:
    33     Ones(Type * const type) : PabloAST(ClassTypeId::Ones, type, nullptr) { }
     33    Ones(Type * const type, Allocator & allocator)
     34    : PabloAST(ClassTypeId::Ones, type, nullptr, allocator) {
     35    }
    3436};
    3537
  • icGREP/icgrep-devel/icgrep/pablo/pe_scanthru.h

    r5227 r5230  
    3030    }
    3131protected:
    32     ScanThru(PabloAST * from, PabloAST * thru, const String * name)
    33     : Statement(ClassTypeId::ScanThru, from->getType(), {from, thru}, name) {
     32    ScanThru(PabloAST * from, PabloAST * thru, const String * name, Allocator & allocator)
     33    : Statement(ClassTypeId::ScanThru, from->getType(), {from, thru}, name, allocator) {
    3434
    3535    }
  • icGREP/icgrep-devel/icgrep/pablo/pe_setithbit.h

    r5217 r5230  
    2727    virtual ~SetIthBit() {}
    2828protected:
    29     explicit SetIthBit(PabloAST * var, PabloAST * position, PabloAST * value, const PabloAST * name)
    30     : Statement(ClassTypeId::SetIthBit, {var, cast<Integer>(position), cast<Integer>(value)}, cast<String>(name)) {
     29    explicit SetIthBit(PabloAST * var, PabloAST * position, PabloAST * value, const PabloAST * name, Allocator & allocator)
     30    : Statement(ClassTypeId::SetIthBit, {var, cast<Integer>(position), cast<Integer>(value)}, cast<String>(name), allocator) {
    3131
    3232    }
  • icGREP/icgrep-devel/icgrep/pablo/pe_string.h

    r5202 r5230  
    3939    }
    4040protected:
    41     String(const std::string & value) noexcept
    42     : PabloAST(ClassTypeId::String, llvm::Type::getInt8PtrTy(llvm::getGlobalContext()), this)
    43     , mValue(duplicate(value))
    44     {
     41    String(Type * type, const std::string & value, Allocator & allocator) noexcept
     42    : PabloAST(ClassTypeId::String, type, this, allocator)
     43    , mValue(duplicate(value, allocator)) {
    4544
    4645    }
    47     inline const char * duplicate(const std::string & value) {
    48         char * string = reinterpret_cast<char*>(mAllocator.allocate(value.length() + 1));
     46
     47    inline const char * duplicate(const std::string & value, Allocator & allocator) {
     48        char * string = reinterpret_cast<char*>(allocator.allocate<char*>(value.length() + 1));
    4949        std::memcpy(string, value.c_str(), value.length());
    5050        string[value.length()] = '\0';
  • icGREP/icgrep-devel/icgrep/pablo/pe_var.h

    r5227 r5230  
    3535    }
    3636protected:
    37     Var(const PabloAST * name, Type * const type, const bool readOnly = false)
    38     : PabloAST(ClassTypeId::Var, type, cast<String>(name))
     37    Var(const PabloAST * name, Type * const type, Allocator & allocator, const bool readOnly = false)
     38    : PabloAST(ClassTypeId::Var, type, cast<String>(name), allocator)
    3939    , mReadOnly(readOnly) {
    4040
     
    6262    }
    6363protected:
    64     Extract(PabloAST * array, PabloAST * const index, const String * const name, Type * type)
    65     : Statement(ClassTypeId::Extract, type, {array, index}, name) {
     64    Extract(PabloAST * array, PabloAST * const index, const String * const name, Type * type, Allocator & allocator)
     65    : Statement(ClassTypeId::Extract, type, {array, index}, name, allocator) {
    6666
    6767    }
  • icGREP/icgrep-devel/icgrep/pablo/pe_zeroes.h

    r5217 r5230  
    3333    }
    3434protected:
    35     Zeroes(Type * const type) : PabloAST(ClassTypeId::Zeroes, type, nullptr) { }
     35    Zeroes(Type * const type, Allocator & allocator)
     36    : PabloAST(ClassTypeId::Zeroes, type, nullptr, allocator) {
     37    }
    3638};
    3739
  • icGREP/icgrep-devel/icgrep/pablo/prototype.cpp

    r5217 r5230  
    55namespace pablo {
    66
    7 Prototype::Prototype(const PabloAST::ClassTypeId type, std::string && name, const unsigned numOfParameters, const unsigned numOfResults)
    8 : PabloAST(type, nullptr, nullptr)
     7Prototype::Prototype(const PabloAST::ClassTypeId type, std::string && name, const unsigned numOfParameters, const unsigned numOfResults, Allocator &allocator)
     8: PabloAST(type, nullptr, nullptr, allocator)
    99, mName(GlobalSymbolGenerator.get(name))
    1010, mNumOfParameters(numOfParameters)
  • icGREP/icgrep-devel/icgrep/pablo/prototype.h

    r5217 r5230  
    2424    }
    2525
    26     static Prototype * Create(std::string name, const unsigned numOfParameters, const unsigned numOfResults, void * functionPtr = nullptr);
     26//    static Prototype * Create(std::string name, const unsigned numOfParameters, const unsigned numOfResults, void * functionPtr = nullptr);
    2727
    2828    const String * getName() const {
     
    3939
    4040protected:
    41     Prototype(const PabloAST::ClassTypeId type, std::string && name, const unsigned numOfParameters, const unsigned numOfResults);
     41    Prototype(const PabloAST::ClassTypeId type, std::string && name, const unsigned numOfParameters, const unsigned numOfResults, Allocator & allocator);
    4242protected:
    4343    const String * const    mName;
     
    4646};
    4747
    48 inline Prototype * Prototype::Create(std::string name, const unsigned numOfParameters, const unsigned numOfResults, void *) {
    49     return new Prototype(PabloAST::ClassTypeId::Prototype, std::move(name), numOfParameters, numOfResults);
    50 }
     48//inline Prototype * Prototype::Create(std::string name, const unsigned numOfParameters, const unsigned numOfResults, void *) {
     49//    return new Prototype(PabloAST::ClassTypeId::Prototype, std::move(name), numOfParameters, numOfResults);
     50//}
    5151
    5252}
  • icGREP/icgrep-devel/icgrep/pablo/ps_assign.h

    r5202 r5230  
    3333    }
    3434protected:
    35     explicit Assign(PabloAST * variable, PabloAST * expr)
    36     : Statement(ClassTypeId::Assign, nullptr, {variable, expr}, nullptr) {
     35    explicit Assign(PabloAST * variable, PabloAST * expr, Allocator & allocator)
     36    : Statement(ClassTypeId::Assign, nullptr, {variable, expr}, nullptr, allocator) {
    3737
    3838    }
  • icGREP/icgrep-devel/icgrep/pablo/symbol_generator.cpp

    r5217 r5230  
    1212namespace pablo {
    1313
    14 String * SymbolGenerator::get(const std::string name) {
     14String * SymbolGenerator::get(const std::string name, IDISA::IDISA_Builder * builder) {
    1515    if (LLVM_UNLIKELY(name.length() == 0)) {
    1616        throw std::runtime_error("symbol name cannot be 0-length");
     
    1919    String * result = nullptr;
    2020    if (f == mStringMap.end()) {
    21         result = new String(name);
     21        result = new (mAllocator) String(builder->getInt8PtrTy(), name, mAllocator);
    2222        assert (result);
    2323        mStringMap.insert(std::make_pair(std::move(name), result));
     
    3333    Integer * result;
    3434    if (f == mIntegerMap.end()) {
    35         result = new Integer(value, builder->getSizeTy());
     35        result = new (mAllocator) Integer(value, builder->getSizeTy(), mAllocator);
    3636        assert (result->value() == value);
    3737        mIntegerMap.insert(std::make_pair(value, result));
     
    4242}
    4343
    44 String * SymbolGenerator::make(const std::string prefix) {
     44String * SymbolGenerator::make(const std::string prefix, IDISA::IDISA_Builder * builder) {
    4545    auto f = mPrefixMap.find(prefix);
    4646    if (f == mPrefixMap.end()) {
    4747        mPrefixMap.insert(std::make_pair(prefix, 1));
    48         return get(prefix);
     48        return get(prefix, builder);
    4949    } else {
    5050        const unsigned count = f->second++;
    51         return get(prefix + '_' + std::to_string(count));
     51        return get(prefix + '_' + std::to_string(count), builder);
    5252    }
    5353}
  • icGREP/icgrep-devel/icgrep/pablo/symbol_generator.h

    r5217 r5230  
    2424    friend class PabloBlock;
    2525    using Twine = llvm::Twine;
     26    using Allocator = PabloAST::Allocator;
    2627public:
    2728    typedef int64_t integer_t;
    28     String * get(const std::string name);
    29     String * make(const std::string prefix);
     29    String * get(const std::string name, IDISA::IDISA_Builder * builder);
     30    String * make(const std::string prefix, IDISA::IDISA_Builder *builder);
    3031    Integer * getInteger(const integer_t value, IDISA::IDISA_Builder * builder);
    31     SymbolGenerator() = default;
     32    SymbolGenerator(Allocator & allocator) : mAllocator(allocator) {}
    3233    ~SymbolGenerator() = default;
    3334private:
     35    Allocator &                                 mAllocator;
    3436    std::unordered_map<std::string, integer_t>  mPrefixMap;
    3537    std::unordered_map<std::string, String *>   mStringMap;
  • icGREP/icgrep-devel/icgrep/re/re_toolchain.cpp

    r5217 r5230  
    1818#include <utf8_encoder.h>
    1919#include <cc/cc_compiler.h>
    20 #include <pablo/prototype.h>
    2120#include <pablo/pablo_kernel.h>
    2221#include <re/printer_re.h>
  • icGREP/icgrep-devel/icgrep/u8u16.cpp

    r5227 r5230  
    2626#include <pablo/pablo_toolchain.h>
    2727#include <pablo/pablo_kernel.h>
    28 #include <pablo/prototype.h>
    2928#include <IDISA/idisa_builder.h>
    3029#include <IDISA/idisa_target.h>
     
    279278    LinearCopybackBuffer U16out(iBuilder, iBuilder->getStreamSetTy(16, 16), segmentSize * bufferSegments + 2);
    280279
    281     s2pKernel s2pk(iBuilder);
     280    S2PKernel s2pk(iBuilder);
    282281
    283282    s2pk.generateKernel({&ByteStream}, {&BasisBits});
    284283
    285     pablo::PabloKernel u8u16k(iBuilder, "u8u16");
     284    PabloKernel u8u16k(iBuilder, "u8u16");
    286285
    287286    u8u16_pablo(&u8u16k);
     
    294293    p2s_16Kernel_withCompressedOutput p2sk(iBuilder);
    295294
    296     stdOutKernel stdoutK(iBuilder, 16);
     295    StdOutKernel stdoutK(iBuilder, 16);
    297296
    298297    if (mMapBuffering || memAlignBuffering) {
     
    305304
    306305    Type * const size_ty = iBuilder->getSizeTy();
    307     Type * const voidTy = Type::getVoidTy(mod->getContext());
     306    Type * const voidTy = iBuilder->getVoidTy();
    308307    Type * const bitBlockType = iBuilder->getBitBlockType();
    309308    Type * const inputType = ArrayType::get(ArrayType::get(bitBlockType, 8), 1)->getPointerTo();
  • icGREP/icgrep-devel/icgrep/util/slab_allocator.h

    r4983 r5230  
    44#include <llvm/Support/Allocator.h>
    55
    6 using LLVMAllocator = llvm::BumpPtrAllocator;
    7 
    86template <typename T>
    97class SlabAllocator {
     8    using LLVMAllocator = llvm::BumpPtrAllocator;
    109public:
    1110
     
    2322    };
    2423
    25     inline pointer allocate(size_type n, const_pointer = nullptr) noexcept {
    26         return static_cast<T*>(mAllocator.Allocate(n * sizeof(T), sizeof(void*)));
     24    template<typename Type = T>
     25    inline Type * allocate(size_type n, const_pointer = nullptr) noexcept {
     26        static_assert(sizeof(Type) > 0, "Cannot allocate a zero-length type.");
     27        assert ("Cannot allocate 0 items." && n > 0);
     28        auto ptr = static_cast<Type *>(mAllocator.Allocate(n * sizeof(Type), sizeof(void*)));
     29        assert ("Allocating returned a null pointer. Function was likely called before Allocator creation!" && ptr);
     30        return ptr;
    2731    }
    2832
    29     inline void deallocate(pointer p, size_type = 0) noexcept {
     33    template<typename Type = T>
     34    inline void deallocate(Type * p, size_type = 0) noexcept {
    3035        mAllocator.Deallocate(p);
    3136    }
     
    3944    }
    4045
    41     void Reset() {
     46    void reset() {
    4247        mAllocator.Reset();
    4348    }
    4449
    45     inline bool operator==(SlabAllocator<T> const&) { return true; }
    46     inline bool operator!=(SlabAllocator<T> const&) { return false; }
     50    template<typename Type = T>
     51    inline bool operator==(SlabAllocator<Type> const & other) {
     52        return &mAllocator == &other.mAllocator;
     53    }
     54
     55    template<typename Type = T>
     56    inline bool operator!=(SlabAllocator<Type> const & other) {
     57        return &mAllocator != &other.mAllocator;
     58    }
    4759
    4860    inline SlabAllocator() noexcept {}
    4961    inline SlabAllocator(const SlabAllocator &) noexcept {}
    5062    template <class U> inline SlabAllocator (const std::allocator<U>&) noexcept {}
    51     inline ~SlabAllocator() { }
     63    inline ~SlabAllocator() { reset(); }
    5264private:
    53     static LLVMAllocator mAllocator;
    54 };
    55 
    56 template <typename T> LLVMAllocator SlabAllocator<T>::mAllocator;
    57 
    58 inline void releaseSlabAllocatorMemory() {
    59     SlabAllocator<void *> T;
    60     T.Reset();
    61 }
    62 
    63 template <typename T>
    64 class LLVMAllocatorProxy {
    65 public:
    66 
    67     using value_type = T;
    68     using pointer = value_type*;
    69     using const_pointer = const value_type*;
    70     using reference = value_type&;
    71     using const_reference = const value_type&;
    72     using size_type = std::size_t;
    73     using difference_type = std::ptrdiff_t;
    74 
    75     template<class U>
    76     struct rebind {
    77         typedef SlabAllocator<U> other;
    78     };
    79 
    80     inline pointer allocate(size_type n, const_pointer = nullptr) noexcept {
    81         return mAllocator.Allocate<T>(n);
    82     }
    83 
    84     inline void deallocate(pointer p, size_type = 0) noexcept {
    85         mAllocator.Deallocate(p);
    86     }
    87 
    88     inline size_type max_size() const {
    89         return std::numeric_limits<size_type>::max();
    90     }
    91 
    92     inline bool operator==(SlabAllocator<T> const&) { return true; }
    93     inline bool operator!=(SlabAllocator<T> const&) { return false; }
    94 
    95     inline LLVMAllocatorProxy(LLVMAllocator & allocator) noexcept : mAllocator(allocator) {}
    96     inline LLVMAllocatorProxy(const LLVMAllocatorProxy & proxy) noexcept : mAllocator(proxy.mAllocator) {}
    97     inline ~LLVMAllocatorProxy() { }
    98 private:
    99     LLVMAllocator & mAllocator;
     65    LLVMAllocator mAllocator;
    10066};
    10167
  • icGREP/icgrep-devel/icgrep/wc.cpp

    r5227 r5230  
    2525#include <re/re_cc.h>
    2626#include <cc/cc_compiler.h>
    27 #include <pablo/prototype.h>
    2827#include <pablo/pablo_kernel.h>
    2928#include <IDISA/idisa_builder.h>
     
    142141    SingleBlockBuffer BasisBits(iBuilder, iBuilder->getStreamSetTy(8, 1));
    143142
    144     s2pKernel  s2pk(iBuilder);
     143    S2PKernel  s2pk(iBuilder);
    145144    std::unique_ptr<Module> s2pM = s2pk.createKernelModule({&ByteStream}, {&BasisBits});
    146145   
     
    156155    Constant * record_counts_routine;
    157156    Type * const size_ty = iBuilder->getSizeTy();
    158     Type * const voidTy = Type::getVoidTy(mMod->getContext());
     157    Type * const voidTy = iBuilder->getVoidTy();
    159158    record_counts_routine = mMod->getOrInsertFunction("record_counts", voidTy, size_ty, size_ty, size_ty, size_ty, size_ty, nullptr);
    160159    Type * const inputType = PointerType::get(ArrayType::get(ArrayType::get(mBitBlockType, 8), 1), 0);
Note: See TracChangeset for help on using the changeset viewer.