Changeset 5267


Ignore:
Timestamp:
Jan 19, 2017, 2:41:02 PM (10 months ago)
Author:
nmedfort
Message:

Code clean-up. Removed Pablo Call, SetIthBit? and Prototype.

Location:
icGREP/icgrep-devel/icgrep
Files:
4 deleted
120 edited

Legend:

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

    r5263 r5267  
    4949
    5050SET(KERNEL_SRC kernels/kernel.cpp kernels/pipeline.cpp kernels/s2p_kernel.cpp kernels/streamset.cpp kernels/interface.cpp kernels/mmap_kernel.cpp)
     51
    5152SET(IDISA_SRC IR_Gen/CBuilder.cpp IR_Gen/types/streamtype.cpp IR_Gen/idisa_builder.cpp IR_Gen/idisa_avx_builder.cpp IR_Gen/idisa_i64_builder.cpp IR_Gen/idisa_sse_builder.cpp IR_Gen/idisa_nvptx_builder.cpp IR_Gen/idisa_target.cpp)
    5253
     
    8788#if(IWYU_PATH)
    8889#cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
    89 execute_process(COMMAND ${CMAKE_CXX_COMPILER} -print-libgcc-file-name OUTPUT_VARIABLE LIBGCC_FILE)
    90 get_filename_component(LIBGCC_PATH ${LIBGCC_FILE} DIRECTORY)
    91 include_directories("${LIBGCC_PATH}/include")
     90#execute_process(COMMAND ${CMAKE_CXX_COMPILER} -print-libgcc-file-name OUTPUT_VARIABLE LIBGCC_FILE)
     91#get_filename_component(LIBGCC_PATH ${LIBGCC_FILE} DIRECTORY)
     92#include_directories("${LIBGCC_PATH}/include")
    9293#set_property(TARGET CodeGen PROPERTY CXX_INCLUDE_WHAT_YOU_USE ${IWYU_PATH})
    9394#set_property(TARGET PabloADT PROPERTY CXX_INCLUDE_WHAT_YOU_USE ${IWYU_PATH})
     
    9899#set_property(TARGET icgrep PROPERTY CXX_INCLUDE_WHAT_YOU_USE ${IWYU_PATH})
    99100#set_property(TARGET u8u16 PROPERTY CXX_INCLUDE_WHAT_YOU_USE ${IWYU_PATH})
     101#set_property(TARGET base64 PROPERTY CXX_INCLUDE_WHAT_YOU_USE ${IWYU_PATH})
    100102#set_property(TARGET wc PROPERTY CXX_INCLUDE_WHAT_YOU_USE ${IWYU_PATH})
    101103#set_property(TARGET editd PROPERTY CXX_INCLUDE_WHAT_YOU_USE ${IWYU_PATH})
  • icGREP/icgrep-devel/icgrep/IR_Gen/CBuilder.cpp

    r5260 r5267  
    66
    77#include "CBuilder.h"
    8 #include <llvm/IR/IRBuilder.h>
    98#include <llvm/IR/Module.h>
    109#include <llvm/IR/Constants.h>
    1110#include <llvm/IR/Intrinsics.h>
    1211#include <llvm/IR/Function.h>
    13 #include <llvm/Support/raw_ostream.h>
    1412#include <llvm/IR/TypeBuilder.h>
    1513
     
    9492    Function * malloc = m->getFunction("malloc");
    9593    if (malloc == nullptr) {
    96         Type * const voidPtrTy = getVoidPtrTy();
     94        PointerType * const voidPtrTy = getVoidPtrTy();
    9795        malloc = cast<Function>(m->getOrInsertFunction("malloc", voidPtrTy, intTy, nullptr));
    9896        malloc->setCallingConv(CallingConv::C);
     
    203201    Function * realloc = m->getFunction("realloc");
    204202    if (realloc == nullptr) {
    205         Type * const voidPtrTy = getVoidPtrTy();
     203        PointerType * const voidPtrTy = getVoidPtrTy();
    206204        realloc = cast<Function>(m->getOrInsertFunction("realloc", voidPtrTy, voidPtrTy, intTy, nullptr));
    207205        realloc->setCallingConv(CallingConv::C);
     
    230228}
    231229
    232 
    233230LoadInst * CBuilder::CreateAtomicLoadAcquire(Value * ptr) {
    234231    unsigned alignment = dyn_cast<PointerType>(ptr->getType())->getElementType()->getPrimitiveSizeInBits()/8;
     
    245242}
    246243
    247 //
    248 // int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
    249 //                    void *(*start_routine)(void*), void *arg);
    250 //
    251244Value * CBuilder::CreatePThreadCreateCall(Value * thread, Value * attr, Function * start_routine, Value * arg) {
    252245    Function * pthreadCreateFunc = mMod->getFunction("pthread_create");
     
    266259}
    267260
    268 //  #include <pthread.h>
    269 //  void pthread_exit(void *value_ptr);
    270 
    271261Value * CBuilder::CreatePThreadExitCall(Value * value_ptr) {
    272262    Function * pthreadExitFunc = mMod->getFunction("pthread_exit");
     
    281271}
    282272
    283 //  int pthread_join(pthread_t thread, void **value_ptr);
    284273Value * CBuilder::CreatePThreadJoinCall(Value * thread, Value * value_ptr){
    285274    Type * pthreadTy = getSizeTy();
     
    292281}
    293282
    294 CBuilder::CBuilder(llvm::Module * m, unsigned archBitWidth, unsigned CacheAlignment)
     283CBuilder::CBuilder(llvm::Module * m, unsigned GeneralRegisterWidthInBits, unsigned CacheLineAlignmentInBytes)
    295284: IRBuilder<>(m->getContext())
    296285, mMod(m)
    297 , mCacheLineAlignment(CacheAlignment)
    298 , mSizeType(getIntNTy(archBitWidth)) {
    299 }
     286, mCacheLineAlignment(CacheLineAlignmentInBytes)
     287, mSizeType(getIntNTy(GeneralRegisterWidthInBits)) {
     288}
  • icGREP/icgrep-devel/icgrep/IR_Gen/CBuilder.h

    r5260 r5267  
    2020public:
    2121   
    22     CBuilder(llvm::Module * m, unsigned archBitWidth, unsigned CacheAlignment=64);
     22    CBuilder(llvm::Module * m, unsigned GeneralRegisterWidthInBits, unsigned CacheLineAlignmentInBytes = 64);
    2323   
    2424    virtual ~CBuilder() {}
     
    3131        mMod = m;
    3232    }
    33    
    34     llvm::Function * GetPrintf();
     33       
    3534    llvm::Value * CreateMalloc(llvm::Type * type, llvm::Value * size);
     35
    3636    llvm::Value * CreateAlignedMalloc(llvm::Type * type, llvm::Value * size, const unsigned alignment);
     37
    3738    void CreateFree(llvm::Value * const ptr);
     39
    3840    void CreateAlignedFree(llvm::Value * const ptr, const bool ptrMayBeNull = false);
     41
    3942    llvm::Value * CreateRealloc(llvm::Value * ptr, llvm::Value * size);
     43
    4044    void CreateMemZero(llvm::Value * ptr, llvm::Value * size, const unsigned alignment = 1);
    4145
     
    4650    }
    4751   
    48     // Create calls to unistd.h functions.
    49     //
    50     // ssize_t write(int fildes, const void *buf, size_t nbyte);
     52    llvm::Function * GetPrintf();
     53
    5154    llvm::Value * CreateWriteCall(llvm::Value * fildes, llvm::Value * buf, llvm::Value * nbyte);
    5255   
    53     // Create calls to Posix thread (pthread.h) functions.
    54     //
    55     //  int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
    56     //                    void *(*start_routine)(void*), void *arg);
    5756    llvm::Value * CreatePThreadCreateCall(llvm::Value * thread, llvm::Value * attr, llvm::Function * start_routine, llvm::Value * arg);
    58     //  void pthread_exit(void *value_ptr);
     57
    5958    llvm::Value * CreatePThreadExitCall(llvm::Value * value_ptr);
    60     //  int pthread_join(pthread_t thread, void **value_ptr);
     59
    6160    llvm::Value * CreatePThreadJoinCall(llvm::Value * thread, llvm::Value * value_ptr);
    6261   
     
    6766    }
    6867   
    69     inline llvm::ConstantInt * getSize(const size_t value) const {
     68    inline llvm::ConstantInt * getSize(const size_t value) {
    7069        return llvm::ConstantInt::get(getSizeTy(), value);
    7170    }
  • icGREP/icgrep-devel/icgrep/IR_Gen/idisa_builder.cpp

    r5260 r5267  
    184184    }
    185185}
    186 
    187186   
    188187Value * IDISA_Builder::esimd_mergeh(unsigned fw, Value * a, Value * b) {
  • icGREP/icgrep-devel/icgrep/IR_Gen/idisa_target.cpp

    r5260 r5267  
    1010#include <IR_Gen/idisa_i64_builder.h>
    1111#include <IR_Gen/idisa_nvptx_builder.h>
     12#include <llvm/ADT/Triple.h>
    1213
    1314namespace IDISA {
    1415   
    15 IDISA_Builder * GetIDISA_Builder(Module * mod) {
     16IDISA_Builder * GetIDISA_Builder(llvm::Module * mod) {
    1617    const bool hasAVX2 = AVX2_available();
    1718    const bool isArch32Bit = Triple(llvm::sys::getProcessTriple()).isArch32Bit();
     
    2930}
    3031
    31 IDISA_Builder * GetIDISA_GPU_Builder(Module * mod) {
     32IDISA_Builder * GetIDISA_GPU_Builder(llvm::Module * mod) {
    3233    return new IDISA_NVPTX20_Builder(mod, 64);
    3334}
  • icGREP/icgrep-devel/icgrep/UCD/CaseFolding_txt.h

    r5145 r5267  
    1010
    1111#include "re/re_cc.h"
    12 #include "re/re_re.h"
    13 #include <utility>
    1412#include <vector>
    1513
  • icGREP/icgrep-devel/icgrep/UCD/resolve_properties.cpp

    r5236 r5267  
    99#include <re/re_name.h>
    1010#include <re/re_diff.h>
    11 #include <re/re_any.h>
    1211#include <re/re_start.h>
    1312#include <re/re_end.h>
    1413#include <re/re_cc.h>
    1514#include <re/re_seq.h>
    16 #include <re/re_rep.h>
    17 #include <re/re_intersect.h>
    1815#include <re/re_assertion.h>
    1916#include "UCD/PropertyAliases.h"
     
    2118#include "UCD/PropertyObjectTable.h"
    2219#include "UCD/PropertyValueAliases.h"
    23 #include <string>
    24 #include <iostream>
    2520
    2621using namespace UCD;
    2722using namespace re;
    28 
     23using namespace llvm;
    2924
    3025inline int GetPropertyValueEnumCode(const UCD::property_t type, const std::string & value) {
  • icGREP/icgrep-devel/icgrep/UCD/ucd_compiler.cpp

    r5206 r5267  
    55#include <utf8_encoder.h>
    66#include <utf16_encoder.h>
    7 #include <iostream>
    87#include <array>
     8#include <pablo/pe_var.h>
     9#include <pablo/pe_zeroes.h>
     10#include <pablo/pe_ones.h>
    911
    1012using namespace cc;
    1113using namespace re;
    1214using namespace pablo;
     15using namespace llvm;
    1316
    1417namespace UCD {
  • icGREP/icgrep-devel/icgrep/UCD/unicode_set.cpp

    r5240 r5267  
    2323#include <llvm/Support/raw_ostream.h>
    2424#include <llvm/Support/Format.h>
    25 #include <array>
    2625
    2726namespace UCD {
  • icGREP/icgrep-devel/icgrep/array-test.cpp

    r5256 r5267  
    55 */
    66
    7 #include <string>
    8 #include <iostream>
    9 #include <iomanip>
    10 #include <fstream>
    11 #include <sstream>
    12 
    13 
    14 #include <toolchain.h>
    15 #include <pablo/pablo_toolchain.h>
    16 #include <llvm/IR/Function.h>
    17 #include <llvm/IR/Module.h>
    18 #include <llvm/ExecutionEngine/ExecutionEngine.h>
    19 #include <llvm/ExecutionEngine/MCJIT.h>
    20 #include "llvm/Linker/Linker.h"
    21 #include <llvm/IR/Verifier.h>
    22 #include <llvm/Support/CommandLine.h>
    23 #include <llvm/Support/raw_ostream.h>
    24 
    25 #include <pablo/pablo_kernel.h>
    26 #include <IR_Gen/idisa_builder.h>
    27 #include <IR_Gen/idisa_target.h>
    28 #include <kernels/streamset.h>
    29 #include <kernels/interface.h>
    30 #include <kernels/kernel.h>
    31 #include <kernels/mmap_kernel.h>
     7#include <IR_Gen/idisa_builder.h>                  // for IDISA_Builder
     8#include <IR_Gen/idisa_target.h>                   // for GetIDISA_Builder
     9#include <kernels/mmap_kernel.h>                   // for MMapSourceKernel
     10#include <kernels/s2p_kernel.h>                    // for S2PKernel
     11#include <kernels/streamset.h>                     // for SingleBlockBuffer
    3212#include <kernels/pipeline.h>
    33 #include <pablo/builder.hpp>
    34 #include <pablo/pablo_compiler.h>
    35 #include <pablo/pablo_toolchain.h>
    36 #include <kernels/s2p_kernel.h>
    37 #include <kernels/stdout_kernel.h>
     13#include <llvm/ExecutionEngine/ExecutionEngine.h>  // for ExecutionEngine
     14#include <llvm/IR/Function.h>                      // for Function, Function...
     15#include <llvm/IR/Module.h>                        // for Module
     16#include <llvm/IR/Verifier.h>                      // for verifyModule
     17#include <llvm/Support/CommandLine.h>              // for ParseCommandLineOp...
     18#include <llvm/Support/raw_ostream.h>              // for errs
     19#include <pablo/pablo_kernel.h>                    // for PabloKernel
     20#include <toolchain.h>                             // for JIT_to_ExecutionEn...
     21#include <pablo/builder.hpp>                       // for PabloBuilder
    3822#include <boost/filesystem.hpp>
    3923#include <boost/iostreams/device/mapped_file.hpp>
    40 
    41 static cl::list<std::string> inputFiles(cl::Positional, cl::desc("<input file ...>"), cl::OneOrMore);
     24#include "llvm/ADT/StringRef.h"                    // for StringRef
     25#include "llvm/IR/CallingConv.h"                   // for ::C
     26#include "llvm/IR/DerivedTypes.h"                  // for ArrayType
     27#include "llvm/IR/LLVMContext.h"                   // for LLVMContext
     28#include "llvm/IR/Value.h"                         // for Value
     29#include "llvm/Support/Debug.h"                    // for dbgs
     30#include <iostream>
     31namespace llvm { class Type; }
     32namespace pablo { class Integer; }
     33namespace pablo { class PabloAST; }
     34namespace pablo { class Var; }
    4235
    4336using namespace pablo;
    4437using namespace kernel;
    4538using namespace parabix;
     39using namespace llvm;
     40
     41static cl::list<std::string> inputFiles(cl::Positional, cl::desc("<input file ...>"), cl::OneOrMore);
    4642
    4743void generate(PabloKernel * kernel, const unsigned size) {
  • icGREP/icgrep-devel/icgrep/base64.cpp

    r5260 r5267  
    55 */
    66
    7 #include <string>
    87#include <iostream>
    9 #include <fstream>
    10 #include <sstream>
    11 #include <stdlib.h>
    12 
    138#include <llvm/IR/Function.h>
    149#include <llvm/IR/Module.h>
    1510#include <llvm/ExecutionEngine/ExecutionEngine.h>
    16 #include <llvm/ExecutionEngine/MCJIT.h>
    17 #include <llvm/IRReader/IRReader.h>
    1811#include <llvm/IR/Verifier.h>
    19 #include <llvm/Support/Debug.h>
    20 
    2112#include <llvm/Support/CommandLine.h>
    22 
    2313#include <toolchain.h>
    2414#include <IR_Gen/idisa_builder.h>
     
    2616#include <kernels/pipeline.h>
    2717#include <kernels/mmap_kernel.h>
    28 #include <kernels/interface.h>
    29 #include <kernels/kernel.h>
     18#include <kernels/streamset.h>
    3019#include <kernels/radix64.h>
    3120#include <kernels/stdout_kernel.h>
    32 
    33 
    34 // mmap system
    3521#include <boost/filesystem.hpp>
    3622#include <boost/iostreams/device/mapped_file.hpp>
    3723#include <boost/interprocess/anonymous_shared_memory.hpp>
    38 #include <boost/interprocess/mapped_region.hpp>
    39 #include <fcntl.h>
    40 
    4124
    4225using namespace llvm;
  • icGREP/icgrep-devel/icgrep/cc/cc_compiler.cpp

    r5230 r5267  
    66
    77#include "cc_compiler.h"
    8 
    9 //Pablo Expressions
    10 #include <re/re_alt.h>
    11 #include <re/re_cc.h>
    12 #include <re/re_seq.h>
    13 #include <re/re_rep.h>
    14 #include <re/re_name.h>
    15 #include <re/re_diff.h>
    16 #include <re/re_intersect.h>
    17 #include <re/re_assertion.h>
    188#include <pablo/codegenstate.h>
     9#include <pablo/boolean.h>
     10#include <pablo/pe_zeroes.h>
     11#include <pablo/pe_ones.h>
    1912#include <pablo/builder.hpp>
    2013#include <pablo/pablo_kernel.h>
    21 #include <stdexcept>
    2214
    2315using namespace re;
    2416using namespace pablo;
     17using namespace llvm;
    2518
    2619namespace cc {
  • icGREP/icgrep-devel/icgrep/cc/cc_compiler.h

    r5217 r5267  
    1212#include <pablo/builder.hpp>
    1313#include <string>
    14 
    15 namespace pablo {
    16     class PabloKernel;
    17     class Var;
    18 }
    1914
    2015namespace cc {
  • icGREP/icgrep-devel/icgrep/editd/editd.cpp

    r5260 r5267  
    77#include <string>
    88#include <iostream>
    9 #include <iomanip>
    109#include <fstream>
    11 #include <sstream>
    12 
    13 
    1410#include <toolchain.h>
    1511#include <pablo/pablo_toolchain.h>
     
    1713#include <llvm/IR/Module.h>
    1814#include <llvm/ExecutionEngine/ExecutionEngine.h>
    19 #include <llvm/ExecutionEngine/MCJIT.h>
    2015#include "llvm/Linker/Linker.h"
    21 
    2216#include <llvm/Support/CommandLine.h>
    23 #include <llvm/Support/raw_ostream.h>
    24 
    25 #include <re/re_cc.h>
    2617#include <cc/cc_compiler.h>
    2718#include <pablo/pablo_compiler.h>
     
    3021#include <IR_Gen/idisa_target.h>
    3122#include <kernels/streamset.h>
    32 #include <kernels/interface.h>
    33 #include <kernels/kernel.h>
    3423#include <kernels/mmap_kernel.h>
    3524#include <kernels/s2p_kernel.h>
    3625#include <editd/editdscan_kernel.h>
    3726#include <kernels/pipeline.h>
    38 
    39 #include <re/re_alt.h>
    4027#include <editd/pattern_compiler.h>
    41 
    42 // mmap system
    4328#include <boost/filesystem.hpp>
    4429#include <boost/iostreams/device/mapped_file.hpp>
    45 #include <fcntl.h>
    4630#include <mutex>
    47 
    4831#ifdef CUDA_ENABLED
    4932#include <editd/EditdCudaDriver.h>
    5033#include <editd/editd_gpu_kernel.h>
    5134#endif
     35
     36using namespace llvm;
    5237
    5338static cl::list<std::string> inputFiles(cl::Positional, cl::desc("<regex> <input file ...>"), cl::OneOrMore);
  • icGREP/icgrep-devel/icgrep/editd/editd_cpu_kernel.cpp

    r5261 r5267  
    33 *  This software is licensed to the public under the Open Software License 3.0.
    44 */
     5
    56#include "editd_cpu_kernel.h"
    6 #include <kernels/kernel.h>
    77#include <IR_Gen/idisa_builder.h>
    88#include <llvm/IR/Module.h>
    9 #include <llvm/Support/raw_ostream.h>
    10 #include <iostream>
    119
    1210using namespace llvm;
  • icGREP/icgrep-devel/icgrep/editd/editd_cpu_kernel.h

    r5260 r5267  
    66#define EDITD_CPU_KERNEL_H
    77
    8 #include <kernels/streamset.h>
    9 #include <kernels/interface.h>
    108#include <kernels/kernel.h>
    119
  • icGREP/icgrep-devel/icgrep/editd/editd_gpu_kernel.cpp

    r5261 r5267  
    44 */
    55#include "editd_gpu_kernel.h"
    6 #include <kernels/kernel.h>
    76#include <IR_Gen/idisa_builder.h>
    87#include <llvm/IR/Module.h>
    9 #include <llvm/Support/raw_ostream.h>
    10 #include <iostream>
    118
    129using namespace llvm;
  • icGREP/icgrep-devel/icgrep/editd/editd_gpu_kernel.h

    r5260 r5267  
    66#define EDITD_GPU_KERNEL_H
    77
    8 #include <kernels/streamset.h>
    9 #include <kernels/interface.h>
    108#include <kernels/kernel.h>
    119
  • icGREP/icgrep-devel/icgrep/editd/editdscan_kernel.cpp

    r5260 r5267  
    66
    77#include "editdscan_kernel.h"
    8 #include <llvm/IR/Intrinsics.h>
    98#include <IR_Gen/idisa_builder.h>
    109#include <llvm/IR/Module.h>
    11 #include <llvm/Support/raw_os_ostream.h>
    12 #include <iostream>
    1310
    1411using namespace llvm;
  • icGREP/icgrep-devel/icgrep/editd/editdscan_kernel.h

    r5260 r5267  
    66#define EDITDSCAN_KERNEL_H
    77
    8 #include <kernels/streamset.h>
    98#include <kernels/kernel.h>
    10 #include <llvm/Support/Host.h>
    11 #include <llvm/ADT/Triple.h>
    12 
    13 namespace llvm { class Module; class Function;}
    14 
    159namespace IDISA { class IDISA_Builder; }
     10namespace llvm { class Function; }
     11namespace llvm { class Module; }
    1612
    1713namespace kernel {
  • icGREP/icgrep-devel/icgrep/editd/pattern_compiler.cpp

    r5230 r5267  
    66
    77#include "pattern_compiler.h"
    8 //Regular Expressions
    9 #include <re/re_name.h>
    10 #include <re/re_any.h>
    11 #include <re/re_start.h>
    12 #include <re/re_end.h>
    13 #include <re/re_alt.h>
    14 #include <re/re_cc.h>
    15 #include <re/re_seq.h>
    16 #include <re/re_rep.h>
    17 #include <re/re_diff.h>
    18 #include <re/re_intersect.h>
    19 #include <re/re_assertion.h>
    20 #include <re/re_analysis.h>
    21 #include <pablo/codegenstate.h>
    22 
    23 #include <assert.h>
    24 #include <stdexcept>
    25 #include <iostream>
    26 
    27 #include "llvm/Support/CommandLine.h"
     8#include <pablo/builder.hpp>
     9#include <pablo/pe_zeroes.h>
     10#include <pablo/pe_ones.h>
    2811
    2912using namespace pablo;
     
    6447
    6548    if (i < patt.length()) {
    66        optimizer(patt, basisBits, e, i, e[i - 1][dist], main, it, dist, stepSize);
     49        optimizer(patt, basisBits, e, i, e[i - 1][dist], main, it, dist, stepSize);
    6750    } else {
    6851        const auto i = patt.length() - 1;
  • icGREP/icgrep-devel/icgrep/editd/pattern_compiler.h

    r5217 r5267  
    88#define PATTERN_COMPILER_H
    99
    10 #include <re/re_re.h>
    11 #include <re/re_seq.h>
    12 #include <cc/cc_compiler.h>
    13 
    1410#include <string>
    15 #include <list>
    16 #include <map>
    17 
    18 namespace pablo {
    19 class PabloBlock;
    20 class PabloKernel;
    21 class PabloAST;
    22 class Assign;
    23 class Var;
    24 }
     11#include <vector>
     12namespace pablo { class PabloAST; }
     13namespace pablo { class PabloBuilder; }
     14namespace pablo { class PabloKernel; }
    2515
    2616namespace re {
  • icGREP/icgrep-devel/icgrep/grep_engine.cpp

    r5255 r5267  
    66
    77#include "grep_engine.h"
     8#include <llvm/IR/Module.h>
    89#include <llvm/ExecutionEngine/MCJIT.h>
    910#include <llvm/IR/Verifier.h>
    10 #include <llvm/IRReader/IRReader.h>
    1111#include <llvm/Support/CommandLine.h>
    12 #include <llvm/Support/Debug.h>
    1312#include <boost/filesystem.hpp>
    1413#include <boost/iostreams/device/mapped_file.hpp>
     
    1817#include <UCD/resolve_properties.h>
    1918#include <kernels/cc_kernel.h>
    20 #include <kernels/kernel.h>
    2119#include <kernels/pipeline.h>
    2220#include <kernels/mmap_kernel.h>
     
    2725#include <pablo/pablo_kernel.h>
    2826#include <pablo/pablo_toolchain.h>
    29 #include <pablo/pablo_toolchain.h>
    3027#include <re/re_cc.h>
    3128#include <re/re_toolchain.h>
     
    3330#include <iostream>
    3431#include <sstream>
    35 #ifdef CUDA_ENABLED 
     32#ifdef CUDA_ENABLED
    3633#include <IR_Gen/CudaDriver.h>
    3734#endif
     
    3936
    4037using namespace parabix;
     38using namespace llvm;
    4139
    4240static cl::OptionCategory bGrepOutputOptions("Output Options",
  • icGREP/icgrep-devel/icgrep/grep_engine.h

    r5241 r5267  
    1 #ifndef DO_GREP_H
    2 #define DO_GREP_H
    31/*
    42 *  Copyright (c) 2016 International Characters.
     
    64 *  icgrep is a trademark of International Characters.
    75 */
    8 
    9 #include <string>
    10 #include <stdint.h>
    11 #include <re/re_re.h>
    12 #include <llvm/ExecutionEngine/ExecutionEngine.h>
    13 #include <grep_type.h>
    14 
    15 
    16 namespace llvm { class raw_ostream; }
    17 
    18 
     6#ifndef DO_GREP_H
     7#define DO_GREP_H
     8#include <grep_type.h>  // for GrepType, GrepType::Normal
     9#include <string>       // for string
     10#include <vector>
     11namespace llvm { class ExecutionEngine; }
     12namespace llvm { class Module; }
     13namespace re { class CC; }
     14namespace re { class RE; }
    1915
    2016class GrepEngine {
     
    2925    void grepCodeGen(std::string moduleName, re::RE * re_ast, bool CountOnly, bool UTF_16 = false, GrepType grepType = GrepType::Normal);
    3026   
    31     void doGrep(const std::string & fileName, const int fileIdx, bool CountOnly, std::vector<size_t> &total_CountOnly, bool UTF_16);
     27    void doGrep(const std::string & fileName, const int fileIdx, bool CountOnly, std::vector<size_t> & total_CountOnly, bool UTF_16);
    3228   
    3329    re::CC *  grepCodepoints();
    34     const std::vector<std::string> & grepPropertyValues(const std::string& propertyName);
     30
     31    const std::vector<std::string> & grepPropertyValues(const std::string & propertyName);
    3532   
    3633private:
     
    4441};
    4542
    46 void icgrep_Linking(Module * m, ExecutionEngine * e);
     43void icgrep_Linking(llvm::Module * m, llvm::ExecutionEngine * e);
    4744
    4845
  • icGREP/icgrep-devel/icgrep/icgrep-devel.files

    r5260 r5267  
    1 basis_bits.h
    2 casefold.cpp
    3 cc/cc_compiler.cpp
    4 cc/cc_compiler.h
    5 cc/cc_compiler_helper.cpp
    6 cc/cc_compiler_helper.h
    7 cc/cc_namemap.cpp
    8 cc/cc_namemap.hpp
    9 cc_compiler.cpp
    10 cc_compiler.h
    11 cc_compiler_helper.cpp
    12 cc_compiler_helper.h
    13 CMakeFiles/3.2.2/CompilerIdC/CMakeCCompilerId.c
    14 CMakeFiles/3.2.2/CompilerIdCXX/CMakeCXXCompilerId.cpp
    15 CMakeFiles/feature_tests.c
    16 CMakeFiles/feature_tests.cxx
    17 CMakeLists.txt
    18 compiler.cpp
    19 compiler.h
    20 do_grep.cpp
    21 do_grep.h
    22 editd/editd.cpp
    23 editd/editdscan_kernel.cpp
    24 editd/editdscan_kernel.h
    25 editd/pattern_compiler.cpp
    26 editd/pattern_compiler.h
    27 generate_predefined_ucd_functions.cpp
    28 grep_engine.cpp
    29 grep_engine.h
    30 hrtime.h
    31 icgrep.cpp
    32 icgrep-devel.config
    33 icgrep-devel.creator
    34 icgrep-devel.creator.user
    35 icgrep-devel.files
    36 icgrep-devel.includes
    37 icgrep.h
    38 IR_Gen/CudaDriver.h
    39 IR_Gen/idisa_avx_builder.cpp
    40 IR_Gen/idisa_avx_builder.h
    41 IR_Gen/idisa_builder.cpp
    42 IR_Gen/idisa_builder.h
    43 IR_Gen/idisa_i64_builder.cpp
    44 IR_Gen/idisa_i64_builder.h
    45 IR_Gen/idisa_nvptx_builder.cpp
    46 IR_Gen/idisa_nvptx_builder.h
    47 IR_Gen/idisa_sse_builder.cpp
    48 IR_Gen/idisa_sse_builder.h
    49 IR_Gen/idisa_target.cpp
    50 IR_Gen/idisa_target.h
    51 IR_Gen/llvm2ptx.h
    52 include/simd-lib/bitblock128.hpp
    53 include/simd-lib/bitblock256.hpp
    54 include/simd-lib/bitblock.hpp
    55 include/simd-lib/bitblock_iterator.hpp
    56 include/simd-lib/buffer.hpp
    57 include/simd-lib/builtins.hpp
    58 include/simd-lib/carryQ.hpp
    59 include/simd-lib/config.hpp
    60 include/simd-lib/idisa128.hpp
    61 include/simd-lib/idisa256.hpp
    62 include/simd-lib/idisa_cpp/idisa_avx2.cpp
    63 include/simd-lib/idisa_cpp/idisa_sse2.cpp
    64 include/simd-lib/idisa.hpp
    65 include/simd-lib/pabloSupport.hpp
    66 include/simd-lib/s2p.hpp
    67 include/simd-lib/transpose.hpp
    68 ispc.cpp
    69 kernels/casefold_pipeline.cpp
    70 kernels/casefold_pipeline.h
    71 kernels/cc_kernel.cpp
    72 kernels/cc_kernel.h
    73 kernels/deletion.cpp
    74 kernels/deletion.h
    75 kernels/instance.cpp
    76 kernels/instance.h
    77 kernels/interface.cpp
    78 kernels/interface.h
    79 kernels/kernel.cpp
    80 kernels/kernel.h
    81 kernels/lane_pipeline.cpp
    82 kernels/lane_pipeline.h
    83 kernels/lane_s2p_kernel.cpp
    84 kernels/lane_s2p_kernel.h
    85 kernels/lookaheadextractor.cpp
    86 kernels/lookaheadextractor.h
    87 kernels/p2s_kernel.cpp
    88 kernels/p2s_kernel.h
    89 kernels/pipeline.cpp
    90 kernels/pipeline.h
    91 kernels/s2p_gen.cpp
    92 kernels/s2p_gen.h
    93 kernels/s2p_kernel.cpp
    94 kernels/s2p_kernel.h
    95 kernels/scanmatchgen.cpp
    96 kernels/scanmatchgen.h
    97 kernels/stdout_kernel.cpp
    98 kernels/stdout_kernel.h
    99 kernels/streamset.cpp
    100 kernels/streamset.h
    101 kernels/symboltablepipeline.cpp
    102 kernels/symboltablepipeline.h
    103 kernels/u8u16_pipeline.cpp
    104 kernels/u8u16_pipeline.h
    105 lanes.cpp
    106 object_cache.cpp
    107 object_cache.h
    108 pablo/analysis/pabloverifier.cpp
    109 pablo/analysis/pabloverifier.hpp
    110 pablo/analysis/useanalysis.cpp
    111 pablo/analysis/useanalysis.h
    112 pablo/branch.cpp
    113 pablo/branch.h
    114 pablo/builder.cpp
    115 pablo/builder.hpp
    116 pablo/carry_data.h
    117 pablo/carry_manager.cpp
    118 pablo/carry_manager.h
    119 pablo/codegenstate.cpp
    120 pablo/codegenstate.h
    121 pablo/expression_map.hpp
    122 pablo/prototype.cpp
    123 pablo/prototype.h
    124 pablo/optimizers/booleanreassociationpass.cpp
    125 pablo/optimizers/booleanreassociationpass.h
    126 pablo/optimizers/codemotionpass.cpp
    127 pablo/optimizers/codemotionpass.h
    128 pablo/optimizers/distributivepass.cpp
    129 pablo/optimizers/distributivepass.h
    130 pablo/optimizers/graph-facade.hpp
    131 pablo/optimizers/maxsat.hpp
    132 pablo/optimizers/pablo_automultiplexing.cpp
    133 pablo/optimizers/pablo_automultiplexing.hpp
    134 pablo/optimizers/pablo_bddminimization.cpp
    135 pablo/optimizers/pablo_bddminimization.h
    136 pablo/optimizers/pablo_codesinking.cpp
    137 pablo/optimizers/pablo_codesinking.hpp
    138 pablo/optimizers/pablo_simplifier.cpp
    139 pablo/optimizers/pablo_simplifier.hpp
    140 pablo/optimizers/schedulingprepass.cpp
    141 pablo/optimizers/schedulingprepass.h
    142 pablo/pabloAST.cpp
    143 pablo/pabloAST.h
    144 pablo/pablo_compiler.cpp
    145 pablo/pablo_compiler.h
    146 pablo/pablo_kernel.cpp
    147 pablo/pablo_kernel.h
    148 pablo/pablo_routines.cpp
    149 pablo/pablo_routines.h
    150 pablo/pablo_toolchain.cpp
    151 pablo/pablo_toolchain.h
    152 pablo/passes/factorizedfg.cpp
    153 pablo/passes/factorizedfg.h
    154 pablo/passes/flattenassociativedfg.cpp
    155 pablo/passes/flattenassociativedfg.h
    156 pablo/passes/flattenif.cpp
    157 pablo/passes/flattenif.hpp
    158 pablo/pbix_compiler.cpp
    159 pablo/pbix_compiler.h
    160 pablo/pe_advance.cpp
    161 pablo/pe_advance.h
    162 pablo/pe_all.cpp
    163 pablo/pe_all.h
    164 pablo/pe_and.cpp
    165 pablo/pe_call.cpp
    166 pablo/pe_call.h
    167 pablo/pe_charclass.cpp
    168 pablo/pe_charclass.h
    169 pablo/pe_constant.h
    170 pablo/pe_count.h
    171 pablo/pe_infile.h
    172 pablo/pe_integer.h
    173 pablo/pe_lookahead.h
    174 pablo/pe_matchstar.cpp
    175 pablo/pe_matchstar.h
    176 pablo/pe_metadata.h
    177 pablo/pe_not.cpp
    178 pablo/pe_ones.h
    179 pablo/pe_or.cpp
    180 pablo/pe_scanthru.cpp
    181 pablo/pe_scanthru.h
    182 pablo/pe_sel.cpp
    183 pablo/pe_setithbit.h
    184 pablo/pe_string.h
    185 pablo/pe_var.h
    186 pablo/pe_xor.cpp
    187 pablo/pe_zeroes.h
    188 pablo/printer_pablos.cpp
    189 pablo/printer_pablos.h
    190 pablo/ps_assign.h
    191 pablo/ps_if.cpp
    192 pablo/ps_if.h
    193 pablo/ps_pablos.cpp
    194 pablo/ps_pablos.h
    195 pablo/ps_while.cpp
    196 pablo/ps_while.h
    197 pablo/symbol_generator.cpp
    198 pablo/symbol_generator.h
    199 pablo/symbol-table/length_group_generator.cpp
    200 pablo/symbol-table/length_group_generator.h
    201 pablo/type.cpp
    202 pablo/type.h
    203 pablo/type/streamtype.cpp
    204 pablo/type/streamtype.h
    205 papi_helper.hpp
    206 re/parsefailure.cpp
    207 re/parsefailure.h
    208 re_parser.cpp
    209 re_parser.h
    210 re/printer_re.cpp
    211 re/printer_re.h
    212 re/re_alt.cpp
    213 re/re_alt.h
    214 re/re_analysis.cpp
    215 re/re_analysis.h
    216 re/re_any.h
    217 re/re_assertion.h
    218 re/re_cc.cpp
    219 re/re_cc.h
    220 re/re_compiler.cpp
    221 re/re_compiler.h
    222 re_re.cpp
    223 re/re_diff.cpp
    224 re/re_diff.h
    225 re_reducer.cpp
    226 re_reducer.h
    227 re/re_end.cpp
    228 re/re_end.h
    229 re/re_grapheme_boundary.hpp
    230 re_re.h
    231 re/re_intersect.cpp
    232 re/re_intersect.h
    233 re/re_memoizer.hpp
    234 re/re_name.cpp
    235 re/re_name.h
    236 re/re_name_resolve.cpp
    237 re/re_name_resolve.h
    238 re/re_nullable.cpp
    239 re/re_nullable.h
    240 re/re_parser.cpp
    241 re/re_parser.h
    242 re_rep.cpp
    243 re_rep.h
    244 re/re_re.cpp
    245 re/re_reducer.cpp
    246 re/re_reducer.h
    247 re/re_re.h
    248 re/re_rep.cpp
    249 re/re_rep.h
    250 re/re_seq.cpp
    251 re/re_seq.h
    252 re/re_simplifier.cpp
    253 re/re_simplifier.h
    254 re/re_start.cpp
    255 re/re_start.h
    256 re/re_toolchain.cpp
    257 re/re_toolchain.h
    258 re_seq.cpp
    259 re_seq.h
    260 re_simplifier.cpp
    261 re_simplifier.h
    262 resolve_properties.cpp
    263 re_start.cpp
    264 re_start.h
    265 re/symbol_generator.cpp
    266 re/symbol_generator.h
    267 slab_allocator.h
    268 symbol_generator.cpp
    269 symbol_generator.h
    270 symboltable.cpp
    271 toolchain.cpp
    272 toolchain.h
    273 u8u16.cpp
    274 UCD/Blocks.h
    275 UCD/CaseFolding_txt.cpp
    276 UCD/CaseFolding_txt.h
    277 UCD/DerivedAge.h
    278 UCD/DerivedBidiClass.h
    279 UCD/DerivedBinaryProperties.h
    280 UCD/DerivedCombiningClass.h
    281 UCD/DerivedCoreProperties.h
    282 UCD/DerivedDecompositionType.h
    283 UCD/DerivedGeneralCategory.h
    284 UCD/DerivedJoiningGroup.h
    285 UCD/DerivedJoiningType.h
    286 UCD/DerivedNormalizationProps.h
    287 UCD/DerivedNumericType.h
    288 UCD/EastAsianWidth.h
    289 UCD/GraphemeBreakProperty.h
    290 UCD/HangulSyllableType.h
    291 UCD/LineBreak.h
    292 UCD/precompiled_blk.cpp
    293 UCD/precompiled_blk.h
    294 UCD/precompiled_derivedcoreproperties.cpp
    295 UCD/precompiled_derivedcoreproperties.h
    296 UCD/precompiled_gc.cpp
    297 UCD/precompiled_gc.h
    298 UCD/precompiled_properties.cpp
    299 UCD/precompiled_properties.h
    300 UCD/precompiled_proplist.cpp
    301 UCD/precompiled_proplist.h
    302 UCD/precompiled_sc.cpp
    303 UCD/precompiled_sc.h
    304 UCD/precompiled_scx.cpp
    305 UCD/precompiled_scx.h
    306 UCD/PropertyAliases.h
    307 UCD/PropertyObjects.cpp
    308 UCD/PropertyObjects.h
    309 UCD/PropertyObjectTable.h
    310 UCD/PropertyValueAliases.h
    311 UCD/PropList.h
    312 UCD/resolve_properties.cpp
    313 UCD/resolve_properties.h
    314 UCD/ScriptExtensions.h
    315 UCD/Scripts.h
    316 UCD/SentenceBreakProperty.h
    317 UCD/ucd_compiler.cpp
    318 UCD/ucd_compiler.hpp
    319 UCD/UnicodeNameData.cpp
    320 UCD/UnicodeNameData.h
    321 UCD/unicode_set.cpp
    322 UCD/unicode_set.h
    323 UCD/WordBreakProperty.h
    324 unicode_categories-flat.h
    325 unicode_categories.h
    326 unicode_categories-simple.h
    327 utf16_encoder.cpp
    328 utf16_encoder.h
    329 utf8_encoder.cpp
    330 utf8_encoder.h
    331 utf_encoding.cpp
    332 utf_encoding.h
    333 util/ispc.cpp
    334 util/ispc.h
    335 util/papi_helper.hpp
    336 util/slab_allocator.h
    337 wc.cpp
    338 pablo/ps_assign.cpp
    339 pablo/pe_var.cpp
    340 pablo/arithmetic.h
    341 pablo/boolean.h
    342 kernels/type/streamtype.cpp
    343 kernels/type/streamtype.h
    344 IR_Gen/types/streamtype.h
    345 editd/pattern_compiler.cpp
    346 editd/editd.cpp
    347 editd/pattern_compiler.h
    348 editd/EditdCudaDriver.h
    349 editd/editd_cpu_kernel.h
    350 editd/editd_gpu_kernel.cpp
    351 editd/editd_cpu_kernel.cpp
    352 editd/editd_gpu_kernel.h
    353 editd/editdscan_kernel.h
    354 editd/editdscan_kernel.cpp
    355 array-test.cpp
    3561cc/cc_compiler.cpp
    3572cc/cc_compiler.h
     
    36611editd/pattern_compiler.cpp
    36712editd/pattern_compiler.h
     13IR_Gen/types/streamtype.cpp
    36814IR_Gen/types/streamtype.h
     15IR_Gen/CBuilder.cpp
     16IR_Gen/CBuilder.h
    36917IR_Gen/CudaDriver.h
    37018IR_Gen/idisa_avx_builder.cpp
     
    38937kernels/kernel.cpp
    39038kernels/kernel.h
     39kernels/mmap_kernel.cpp
     40kernels/mmap_kernel.h
    39141kernels/p2s_kernel.cpp
    39242kernels/p2s_kernel.h
     
    450100pablo/pabloAST.h
    451101pablo/pe_advance.h
    452 pablo/pe_call.h
    453102pablo/pe_constant.h
    454103pablo/pe_count.h
     
    459108pablo/pe_ones.h
    460109pablo/pe_scanthru.h
    461 pablo/pe_setithbit.h
    462110pablo/pe_string.h
    463111pablo/pe_var.h
     
    465113pablo/printer_pablos.cpp
    466114pablo/printer_pablos.h
    467 pablo/prototype.cpp
    468 pablo/prototype.h
    469 pablo/ps_assign.h
    470 pablo/symbol_generator.cpp
    471 pablo/symbol_generator.h
    472 re/printer_re.cpp
    473 re/printer_re.h
    474 re/re_alt.h
    475 re/re_analysis.cpp
    476 re/re_analysis.h
    477 re/re_any.h
    478 re/re_assertion.h
    479 re/re_cc.cpp
    480 re/re_cc.h
    481 re/re_compiler.cpp
    482 re/re_compiler.h
    483 re/re_diff.cpp
    484 re/re_diff.h
    485 re/re_end.h
    486 re/re_intersect.cpp
    487 re/re_intersect.h
    488 re/re_memoizer.hpp
    489 re/re_name.h
    490 re/re_name_resolve.cpp
    491 re/re_name_resolve.h
    492 re/re_nullable.cpp
    493 re/re_nullable.h
    494 re/re_parser.cpp
    495 re/re_parser.h
    496 re/re_parser_bre.cpp
    497 re/re_parser_bre.h
    498 re/re_parser_ere.cpp
    499 re/re_parser_ere.h
    500 re/re_parser_helper.h
    501 re/re_parser_pcre.cpp
    502 re/re_parser_pcre.h
    503 re/re_parser_prosite.cpp
    504 re/re_parser_prosite.h
    505 re/re_re.cpp
    506 re/re_re.h
    507 re/re_rep.cpp
    508 re/re_rep.h
    509 re/re_seq.h
    510 re/re_simplifier.cpp
    511 re/re_simplifier.h
    512 re/re_start.h
    513 re/re_toolchain.cpp
    514 re/re_toolchain.h
    515 re/re_utility.cpp
    516 re/re_utility.h
    517 UCD/Blocks.h
    518 UCD/CaseFolding_txt.cpp
    519 UCD/CaseFolding_txt.h
    520 UCD/DerivedAge.h
    521 UCD/DerivedBidiClass.h
    522 UCD/DerivedBinaryProperties.h
    523 UCD/DerivedCombiningClass.h
    524 UCD/DerivedCoreProperties.h
    525 UCD/DerivedDecompositionType.h
    526 UCD/DerivedGeneralCategory.h
    527 UCD/DerivedJoiningGroup.h
    528 UCD/DerivedJoiningType.h
    529 UCD/DerivedNormalizationProps.h
    530 UCD/DerivedNumericType.h
    531 UCD/EastAsianWidth.h
    532 UCD/GraphemeBreakProperty.h
    533 UCD/HangulSyllableType.h
    534 UCD/LineBreak.h
    535 UCD/PropertyAliases.h
    536 UCD/PropertyObjects.cpp
    537 UCD/PropertyObjects.h
    538 UCD/PropertyObjectTable.h
    539 UCD/PropertyValueAliases.h
    540 UCD/PropList.h
    541 UCD/resolve_properties.cpp
    542 UCD/resolve_properties.h
    543 UCD/ScriptExtensions.h
    544 UCD/Scripts.h
    545 UCD/SentenceBreakProperty.h
    546 UCD/ucd_compiler.cpp
    547 UCD/ucd_compiler.hpp
    548 UCD/unicode_set.cpp
    549 UCD/unicode_set.h
    550 UCD/UnicodeNameData.cpp
    551 UCD/UnicodeNameData.h
    552 UCD/WordBreakProperty.h
    553 util/papi_helper.hpp
    554 util/slab_allocator.h
    555 array-test.cpp
    556 generate_predefined_ucd_functions.cpp
    557 grep_engine.cpp
    558 grep_engine.h
    559 grep_type.h
    560 hrtime.h
    561 icgrep.cpp
    562 object_cache.cpp
    563 object_cache.h
    564 symboltable.cpp
    565 toolchain.cpp
    566 toolchain.h
    567 u8u16.cpp
    568 utf16_encoder.cpp
    569 utf16_encoder.h
    570 utf8_encoder.cpp
    571 utf8_encoder.h
    572 wc.cpp
    573 IR_Gen/types/streamtype.cpp
    574 IR_Gen/types/streamtype.cpp
    575 base64.cpp
    576 util/aligned_allocator.h
    577 cc/cc_compiler.cpp
    578 cc/cc_compiler.h
    579 editd/editd.cpp
    580 editd/editd_cpu_kernel.cpp
    581 editd/editd_cpu_kernel.h
    582 editd/editd_gpu_kernel.cpp
    583 editd/editd_gpu_kernel.h
    584 editd/EditdCudaDriver.h
    585 editd/editdscan_kernel.cpp
    586 editd/editdscan_kernel.h
    587 editd/pattern_compiler.cpp
    588 editd/pattern_compiler.h
    589 IR_Gen/types/streamtype.cpp
    590 IR_Gen/types/streamtype.h
    591 IR_Gen/CBuilder.cpp
    592 IR_Gen/CBuilder.h
    593 IR_Gen/CudaDriver.h
    594 IR_Gen/idisa_avx_builder.cpp
    595 IR_Gen/idisa_avx_builder.h
    596 IR_Gen/idisa_builder.cpp
    597 IR_Gen/idisa_builder.h
    598 IR_Gen/idisa_i64_builder.cpp
    599 IR_Gen/idisa_i64_builder.h
    600 IR_Gen/idisa_nvptx_builder.cpp
    601 IR_Gen/idisa_nvptx_builder.h
    602 IR_Gen/idisa_sse_builder.cpp
    603 IR_Gen/idisa_sse_builder.h
    604 IR_Gen/idisa_target.cpp
    605 IR_Gen/idisa_target.h
    606 IR_Gen/llvm2ptx.h
    607 kernels/cc_kernel.cpp
    608 kernels/cc_kernel.h
    609 kernels/deletion.cpp
    610 kernels/deletion.h
    611 kernels/interface.cpp
    612 kernels/interface.h
    613 kernels/kernel.cpp
    614 kernels/kernel.h
    615 kernels/p2s_kernel.cpp
    616 kernels/p2s_kernel.h
    617 kernels/pipeline.cpp
    618 kernels/pipeline.h
    619 kernels/radix64.cpp
    620 kernels/radix64.h
    621 kernels/s2p_kernel.cpp
    622 kernels/s2p_kernel.h
    623 kernels/scanmatchgen.cpp
    624 kernels/scanmatchgen.h
    625 kernels/stdout_kernel.cpp
    626 kernels/stdout_kernel.h
    627 kernels/streamset.cpp
    628 kernels/streamset.h
    629 kernels/symboltablepipeline.cpp
    630 kernels/symboltablepipeline.h
    631 pablo/analysis/pabloverifier.cpp
    632 pablo/analysis/pabloverifier.hpp
    633 pablo/optimizers/booleanreassociationpass.cpp
    634 pablo/optimizers/booleanreassociationpass.h
    635 pablo/optimizers/codemotionpass.cpp
    636 pablo/optimizers/codemotionpass.h
    637 pablo/optimizers/distributivepass.cpp
    638 pablo/optimizers/distributivepass.h
    639 pablo/optimizers/graph-facade.hpp
    640 pablo/optimizers/maxsat.hpp
    641 pablo/optimizers/pablo_automultiplexing.cpp
    642 pablo/optimizers/pablo_automultiplexing.hpp
    643 pablo/optimizers/pablo_bddminimization.cpp
    644 pablo/optimizers/pablo_bddminimization.h
    645 pablo/optimizers/pablo_simplifier.cpp
    646 pablo/optimizers/pablo_simplifier.hpp
    647 pablo/optimizers/schedulingprepass.cpp
    648 pablo/optimizers/schedulingprepass.h
    649 pablo/passes/factorizedfg.cpp
    650 pablo/passes/factorizedfg.h
    651 pablo/passes/flattenassociativedfg.cpp
    652 pablo/passes/flattenassociativedfg.h
    653 pablo/passes/flattenif.cpp
    654 pablo/passes/flattenif.hpp
    655 pablo/arithmetic.h
    656 pablo/boolean.h
    657 pablo/branch.cpp
    658 pablo/branch.h
    659 pablo/builder.cpp
    660 pablo/builder.hpp
    661 pablo/carry_data.h
    662 pablo/carry_manager.cpp
    663 pablo/carry_manager.h
    664 pablo/codegenstate.cpp
    665 pablo/codegenstate.h
    666 pablo/expression_map.hpp
    667 pablo/pablo_compiler.cpp
    668 pablo/pablo_compiler.h
    669 pablo/pablo_kernel.cpp
    670 pablo/pablo_kernel.h
    671 pablo/pablo_toolchain.cpp
    672 pablo/pablo_toolchain.h
    673 pablo/pabloAST.cpp
    674 pablo/pabloAST.h
    675 pablo/pe_advance.h
    676 pablo/pe_call.h
    677 pablo/pe_constant.h
    678 pablo/pe_count.h
    679 pablo/pe_infile.h
    680 pablo/pe_integer.h
    681 pablo/pe_lookahead.h
    682 pablo/pe_matchstar.h
    683 pablo/pe_ones.h
    684 pablo/pe_scanthru.h
    685 pablo/pe_setithbit.h
    686 pablo/pe_string.h
    687 pablo/pe_var.h
    688 pablo/pe_zeroes.h
    689 pablo/printer_pablos.cpp
    690 pablo/printer_pablos.h
    691 pablo/prototype.cpp
    692 pablo/prototype.h
    693115pablo/ps_assign.h
    694116pablo/symbol_generator.cpp
     
    797219utf8_encoder.h
    798220wc.cpp
    799 cc/cc_compiler.cpp
    800 cc/cc_compiler.h
    801 editd/editd.cpp
    802 editd/editd_cpu_kernel.cpp
    803 editd/editd_cpu_kernel.h
    804 editd/editd_gpu_kernel.cpp
    805 editd/editd_gpu_kernel.h
    806 editd/EditdCudaDriver.h
    807 editd/editdscan_kernel.cpp
    808 editd/editdscan_kernel.h
    809 editd/pattern_compiler.cpp
    810 editd/pattern_compiler.h
    811 IR_Gen/types/streamtype.cpp
    812 IR_Gen/types/streamtype.h
    813 IR_Gen/CBuilder.cpp
    814 IR_Gen/CBuilder.h
    815 IR_Gen/CudaDriver.h
    816 IR_Gen/idisa_avx_builder.cpp
    817 IR_Gen/idisa_avx_builder.h
    818 IR_Gen/idisa_builder.cpp
    819 IR_Gen/idisa_builder.h
    820 IR_Gen/idisa_i64_builder.cpp
    821 IR_Gen/idisa_i64_builder.h
    822 IR_Gen/idisa_nvptx_builder.cpp
    823 IR_Gen/idisa_nvptx_builder.h
    824 IR_Gen/idisa_sse_builder.cpp
    825 IR_Gen/idisa_sse_builder.h
    826 IR_Gen/idisa_target.cpp
    827 IR_Gen/idisa_target.h
    828 IR_Gen/llvm2ptx.h
    829 kernels/cc_kernel.cpp
    830 kernels/cc_kernel.h
    831 kernels/deletion.cpp
    832 kernels/deletion.h
    833 kernels/interface.cpp
    834 kernels/interface.h
    835 kernels/kernel.cpp
    836 kernels/kernel.h
    837 kernels/mmap_kernel.cpp
    838 kernels/mmap_kernel.h
    839 kernels/p2s_kernel.cpp
    840 kernels/p2s_kernel.h
    841 kernels/pipeline.cpp
    842 kernels/pipeline.h
    843 kernels/radix64.cpp
    844 kernels/radix64.h
    845 kernels/s2p_kernel.cpp
    846 kernels/s2p_kernel.h
    847 kernels/scanmatchgen.cpp
    848 kernels/scanmatchgen.h
    849 kernels/stdout_kernel.cpp
    850 kernels/stdout_kernel.h
    851 kernels/streamset.cpp
    852 kernels/streamset.h
    853 kernels/symboltablepipeline.cpp
    854 kernels/symboltablepipeline.h
    855 pablo/analysis/pabloverifier.cpp
    856 pablo/analysis/pabloverifier.hpp
    857 pablo/optimizers/booleanreassociationpass.cpp
    858 pablo/optimizers/booleanreassociationpass.h
    859 pablo/optimizers/codemotionpass.cpp
    860 pablo/optimizers/codemotionpass.h
    861 pablo/optimizers/distributivepass.cpp
    862 pablo/optimizers/distributivepass.h
    863 pablo/optimizers/graph-facade.hpp
    864 pablo/optimizers/maxsat.hpp
    865 pablo/optimizers/pablo_automultiplexing.cpp
    866 pablo/optimizers/pablo_automultiplexing.hpp
    867 pablo/optimizers/pablo_bddminimization.cpp
    868 pablo/optimizers/pablo_bddminimization.h
    869 pablo/optimizers/pablo_simplifier.cpp
    870 pablo/optimizers/pablo_simplifier.hpp
    871 pablo/optimizers/schedulingprepass.cpp
    872 pablo/optimizers/schedulingprepass.h
    873 pablo/passes/factorizedfg.cpp
    874 pablo/passes/factorizedfg.h
    875 pablo/passes/flattenassociativedfg.cpp
    876 pablo/passes/flattenassociativedfg.h
    877 pablo/passes/flattenif.cpp
    878 pablo/passes/flattenif.hpp
    879 pablo/arithmetic.h
    880 pablo/boolean.h
    881 pablo/branch.cpp
    882 pablo/branch.h
    883 pablo/builder.cpp
    884 pablo/builder.hpp
    885 pablo/carry_data.h
    886 pablo/carry_manager.cpp
    887 pablo/carry_manager.h
    888 pablo/codegenstate.cpp
    889 pablo/codegenstate.h
    890 pablo/expression_map.hpp
    891 pablo/pablo_compiler.cpp
    892 pablo/pablo_compiler.h
    893 pablo/pablo_kernel.cpp
    894 pablo/pablo_kernel.h
    895 pablo/pablo_toolchain.cpp
    896 pablo/pablo_toolchain.h
    897 pablo/pabloAST.cpp
    898 pablo/pabloAST.h
    899 pablo/pe_advance.h
    900 pablo/pe_call.h
    901 pablo/pe_constant.h
    902 pablo/pe_count.h
    903 pablo/pe_infile.h
    904 pablo/pe_integer.h
    905 pablo/pe_lookahead.h
    906 pablo/pe_matchstar.h
    907 pablo/pe_ones.h
    908 pablo/pe_scanthru.h
    909 pablo/pe_setithbit.h
    910 pablo/pe_string.h
    911 pablo/pe_var.h
    912 pablo/pe_zeroes.h
    913 pablo/printer_pablos.cpp
    914 pablo/printer_pablos.h
    915 pablo/prototype.cpp
    916 pablo/prototype.h
    917 pablo/ps_assign.h
    918 pablo/symbol_generator.cpp
    919 pablo/symbol_generator.h
    920 re/printer_re.cpp
    921 re/printer_re.h
    922 re/re_alt.h
    923 re/re_analysis.cpp
    924 re/re_analysis.h
    925 re/re_any.h
    926 re/re_assertion.h
    927 re/re_cc.cpp
    928 re/re_cc.h
    929 re/re_compiler.cpp
    930 re/re_compiler.h
    931 re/re_diff.cpp
    932 re/re_diff.h
    933 re/re_end.h
    934 re/re_intersect.cpp
    935 re/re_intersect.h
    936 re/re_memoizer.hpp
    937 re/re_name.h
    938 re/re_name_resolve.cpp
    939 re/re_name_resolve.h
    940 re/re_nullable.cpp
    941 re/re_nullable.h
    942 re/re_parser.cpp
    943 re/re_parser.h
    944 re/re_parser_bre.cpp
    945 re/re_parser_bre.h
    946 re/re_parser_ere.cpp
    947 re/re_parser_ere.h
    948 re/re_parser_helper.h
    949 re/re_parser_pcre.cpp
    950 re/re_parser_pcre.h
    951 re/re_parser_prosite.cpp
    952 re/re_parser_prosite.h
    953 re/re_re.cpp
    954 re/re_re.h
    955 re/re_rep.cpp
    956 re/re_rep.h
    957 re/re_seq.h
    958 re/re_simplifier.cpp
    959 re/re_simplifier.h
    960 re/re_start.h
    961 re/re_toolchain.cpp
    962 re/re_toolchain.h
    963 re/re_utility.cpp
    964 re/re_utility.h
    965 UCD/Blocks.h
    966 UCD/CaseFolding_txt.cpp
    967 UCD/CaseFolding_txt.h
    968 UCD/DerivedAge.h
    969 UCD/DerivedBidiClass.h
    970 UCD/DerivedBinaryProperties.h
    971 UCD/DerivedCombiningClass.h
    972 UCD/DerivedCoreProperties.h
    973 UCD/DerivedDecompositionType.h
    974 UCD/DerivedGeneralCategory.h
    975 UCD/DerivedJoiningGroup.h
    976 UCD/DerivedJoiningType.h
    977 UCD/DerivedNormalizationProps.h
    978 UCD/DerivedNumericType.h
    979 UCD/EastAsianWidth.h
    980 UCD/GraphemeBreakProperty.h
    981 UCD/HangulSyllableType.h
    982 UCD/LineBreak.h
    983 UCD/PropertyAliases.h
    984 UCD/PropertyObjects.cpp
    985 UCD/PropertyObjects.h
    986 UCD/PropertyObjectTable.h
    987 UCD/PropertyValueAliases.h
    988 UCD/PropList.h
    989 UCD/resolve_properties.cpp
    990 UCD/resolve_properties.h
    991 UCD/ScriptExtensions.h
    992 UCD/Scripts.h
    993 UCD/SentenceBreakProperty.h
    994 UCD/ucd_compiler.cpp
    995 UCD/ucd_compiler.hpp
    996 UCD/unicode_set.cpp
    997 UCD/unicode_set.h
    998 UCD/UnicodeNameData.cpp
    999 UCD/UnicodeNameData.h
    1000 UCD/WordBreakProperty.h
    1001 util/aligned_allocator.h
    1002 util/papi_helper.hpp
    1003 util/slab_allocator.h
    1004 array-test.cpp
    1005 base64.cpp
    1006 generate_predefined_ucd_functions.cpp
    1007 grep_engine.cpp
    1008 grep_engine.h
    1009 grep_type.h
    1010 hrtime.h
    1011 icgrep.cpp
    1012 object_cache.cpp
    1013 object_cache.h
    1014 symboltable.cpp
    1015 toolchain.cpp
    1016 toolchain.h
    1017 u8u16.cpp
    1018 utf16_encoder.cpp
    1019 utf16_encoder.h
    1020 utf8_encoder.cpp
    1021 utf8_encoder.h
    1022 wc.cpp
    1023 cc/cc_compiler.cpp
    1024 cc/cc_compiler.h
    1025 editd/editd.cpp
    1026 editd/editd_cpu_kernel.cpp
    1027 editd/editd_cpu_kernel.h
    1028 editd/editd_gpu_kernel.cpp
    1029 editd/editd_gpu_kernel.h
    1030 editd/EditdCudaDriver.h
    1031 editd/editdscan_kernel.cpp
    1032 editd/editdscan_kernel.h
    1033 editd/pattern_compiler.cpp
    1034 editd/pattern_compiler.h
    1035 IR_Gen/types/streamtype.cpp
    1036 IR_Gen/types/streamtype.h
    1037 IR_Gen/CBuilder.cpp
    1038 IR_Gen/CBuilder.h
    1039 IR_Gen/CudaDriver.h
    1040 IR_Gen/idisa_avx_builder.cpp
    1041 IR_Gen/idisa_avx_builder.h
    1042 IR_Gen/idisa_builder.cpp
    1043 IR_Gen/idisa_builder.h
    1044 IR_Gen/idisa_i64_builder.cpp
    1045 IR_Gen/idisa_i64_builder.h
    1046 IR_Gen/idisa_nvptx_builder.cpp
    1047 IR_Gen/idisa_nvptx_builder.h
    1048 IR_Gen/idisa_sse_builder.cpp
    1049 IR_Gen/idisa_sse_builder.h
    1050 IR_Gen/idisa_target.cpp
    1051 IR_Gen/idisa_target.h
    1052 IR_Gen/llvm2ptx.h
    1053 kernels/cc_kernel.cpp
    1054 kernels/cc_kernel.h
    1055 kernels/deletion.cpp
    1056 kernels/deletion.h
    1057 kernels/interface.cpp
    1058 kernels/interface.h
    1059 kernels/kernel.cpp
    1060 kernels/kernel.h
    1061 kernels/mmap_kernel.cpp
    1062 kernels/mmap_kernel.h
    1063 kernels/p2s_kernel.cpp
    1064 kernels/p2s_kernel.h
    1065 kernels/pipeline.cpp
    1066 kernels/pipeline.h
    1067 kernels/radix64.cpp
    1068 kernels/radix64.h
    1069 kernels/s2p_kernel.cpp
    1070 kernels/s2p_kernel.h
    1071 kernels/scanmatchgen.cpp
    1072 kernels/scanmatchgen.h
    1073 kernels/stdout_kernel.cpp
    1074 kernels/stdout_kernel.h
    1075 kernels/streamset.cpp
    1076 kernels/streamset.h
    1077 kernels/symboltablepipeline.cpp
    1078 kernels/symboltablepipeline.h
    1079 pablo/analysis/pabloverifier.cpp
    1080 pablo/analysis/pabloverifier.hpp
    1081 pablo/optimizers/booleanreassociationpass.cpp
    1082 pablo/optimizers/booleanreassociationpass.h
    1083 pablo/optimizers/codemotionpass.cpp
    1084 pablo/optimizers/codemotionpass.h
    1085 pablo/optimizers/distributivepass.cpp
    1086 pablo/optimizers/distributivepass.h
    1087 pablo/optimizers/graph-facade.hpp
    1088 pablo/optimizers/maxsat.hpp
    1089 pablo/optimizers/pablo_automultiplexing.cpp
    1090 pablo/optimizers/pablo_automultiplexing.hpp
    1091 pablo/optimizers/pablo_bddminimization.cpp
    1092 pablo/optimizers/pablo_bddminimization.h
    1093 pablo/optimizers/pablo_simplifier.cpp
    1094 pablo/optimizers/pablo_simplifier.hpp
    1095 pablo/optimizers/schedulingprepass.cpp
    1096 pablo/optimizers/schedulingprepass.h
    1097 pablo/passes/factorizedfg.cpp
    1098 pablo/passes/factorizedfg.h
    1099 pablo/passes/flattenassociativedfg.cpp
    1100 pablo/passes/flattenassociativedfg.h
    1101 pablo/passes/flattenif.cpp
    1102 pablo/passes/flattenif.hpp
    1103 pablo/arithmetic.h
    1104 pablo/boolean.h
    1105 pablo/branch.cpp
    1106 pablo/branch.h
    1107 pablo/builder.cpp
    1108 pablo/builder.hpp
    1109 pablo/carry_data.h
    1110 pablo/carry_manager.cpp
    1111 pablo/carry_manager.h
    1112 pablo/codegenstate.cpp
    1113 pablo/codegenstate.h
    1114 pablo/expression_map.hpp
    1115 pablo/pablo_compiler.cpp
    1116 pablo/pablo_compiler.h
    1117 pablo/pablo_kernel.cpp
    1118 pablo/pablo_kernel.h
    1119 pablo/pablo_toolchain.cpp
    1120 pablo/pablo_toolchain.h
    1121 pablo/pabloAST.cpp
    1122 pablo/pabloAST.h
    1123 pablo/pe_advance.h
    1124 pablo/pe_call.h
    1125 pablo/pe_constant.h
    1126 pablo/pe_count.h
    1127 pablo/pe_infile.h
    1128 pablo/pe_integer.h
    1129 pablo/pe_lookahead.h
    1130 pablo/pe_matchstar.h
    1131 pablo/pe_ones.h
    1132 pablo/pe_scanthru.h
    1133 pablo/pe_setithbit.h
    1134 pablo/pe_string.h
    1135 pablo/pe_var.h
    1136 pablo/pe_zeroes.h
    1137 pablo/printer_pablos.cpp
    1138 pablo/printer_pablos.h
    1139 pablo/prototype.cpp
    1140 pablo/prototype.h
    1141 pablo/ps_assign.h
    1142 pablo/symbol_generator.cpp
    1143 pablo/symbol_generator.h
    1144 re/printer_re.cpp
    1145 re/printer_re.h
    1146 re/re_alt.h
    1147 re/re_analysis.cpp
    1148 re/re_analysis.h
    1149 re/re_any.h
    1150 re/re_assertion.h
    1151 re/re_cc.cpp
    1152 re/re_cc.h
    1153 re/re_compiler.cpp
    1154 re/re_compiler.h
    1155 re/re_diff.cpp
    1156 re/re_diff.h
    1157 re/re_end.h
    1158 re/re_intersect.cpp
    1159 re/re_intersect.h
    1160 re/re_memoizer.hpp
    1161 re/re_name.h
    1162 re/re_name_resolve.cpp
    1163 re/re_name_resolve.h
    1164 re/re_nullable.cpp
    1165 re/re_nullable.h
    1166 re/re_parser.cpp
    1167 re/re_parser.h
    1168 re/re_parser_bre.cpp
    1169 re/re_parser_bre.h
    1170 re/re_parser_ere.cpp
    1171 re/re_parser_ere.h
    1172 re/re_parser_helper.h
    1173 re/re_parser_pcre.cpp
    1174 re/re_parser_pcre.h
    1175 re/re_parser_prosite.cpp
    1176 re/re_parser_prosite.h
    1177 re/re_re.cpp
    1178 re/re_re.h
    1179 re/re_rep.cpp
    1180 re/re_rep.h
    1181 re/re_seq.h
    1182 re/re_simplifier.cpp
    1183 re/re_simplifier.h
    1184 re/re_start.h
    1185 re/re_toolchain.cpp
    1186 re/re_toolchain.h
    1187 re/re_utility.cpp
    1188 re/re_utility.h
    1189 UCD/Blocks.h
    1190 UCD/CaseFolding_txt.cpp
    1191 UCD/CaseFolding_txt.h
    1192 UCD/DerivedAge.h
    1193 UCD/DerivedBidiClass.h
    1194 UCD/DerivedBinaryProperties.h
    1195 UCD/DerivedCombiningClass.h
    1196 UCD/DerivedCoreProperties.h
    1197 UCD/DerivedDecompositionType.h
    1198 UCD/DerivedGeneralCategory.h
    1199 UCD/DerivedJoiningGroup.h
    1200 UCD/DerivedJoiningType.h
    1201 UCD/DerivedNormalizationProps.h
    1202 UCD/DerivedNumericType.h
    1203 UCD/EastAsianWidth.h
    1204 UCD/GraphemeBreakProperty.h
    1205 UCD/HangulSyllableType.h
    1206 UCD/LineBreak.h
    1207 UCD/PropertyAliases.h
    1208 UCD/PropertyObjects.cpp
    1209 UCD/PropertyObjects.h
    1210 UCD/PropertyObjectTable.h
    1211 UCD/PropertyValueAliases.h
    1212 UCD/PropList.h
    1213 UCD/resolve_properties.cpp
    1214 UCD/resolve_properties.h
    1215 UCD/ScriptExtensions.h
    1216 UCD/Scripts.h
    1217 UCD/SentenceBreakProperty.h
    1218 UCD/ucd_compiler.cpp
    1219 UCD/ucd_compiler.hpp
    1220 UCD/unicode_set.cpp
    1221 UCD/unicode_set.h
    1222 UCD/UnicodeNameData.cpp
    1223 UCD/UnicodeNameData.h
    1224 UCD/WordBreakProperty.h
    1225 util/aligned_allocator.h
    1226 util/papi_helper.hpp
    1227 util/slab_allocator.h
    1228 array-test.cpp
    1229 base64.cpp
    1230 generate_predefined_ucd_functions.cpp
    1231 grep_engine.cpp
    1232 grep_engine.h
    1233 grep_type.h
    1234 hrtime.h
    1235 icgrep.cpp
    1236 object_cache.cpp
    1237 object_cache.h
    1238 symboltable.cpp
    1239 toolchain.cpp
    1240 toolchain.h
    1241 u8u16.cpp
    1242 utf16_encoder.cpp
    1243 utf16_encoder.h
    1244 utf8_encoder.cpp
    1245 utf8_encoder.h
    1246 wc.cpp
     221CMakeLists.txt
  • icGREP/icgrep-devel/icgrep/icgrep.cpp

    r5236 r5267  
    1010#include <llvm/Support/ErrorHandling.h>
    1111#include <llvm/Support/Signals.h>
     12#include <llvm/Support/raw_ostream.h>
    1213#include <re/re_alt.h>
    1314#include <re/re_seq.h>
     
    1920#include <fstream>
    2021#include <string>
    21 
    2222#include <boost/uuid/sha1.hpp>
    2323#include <toolchain.h>
     
    2626#include <mutex>
    2727#include <boost/filesystem.hpp>
    28 
    2928#include <iostream> // MEEE
    30 
    3129#ifdef PRINT_TIMING_INFORMATION
    3230#include <hrtime.h>
    3331#include <util/papi_helper.hpp>
    3432#endif
     33
     34using namespace llvm;
    3535
    3636static cl::OptionCategory LegacyGrepOptions("A. Standard Grep Options",
     
    193193    }
    194194
    195     pthread_exit(NULL);
     195    pthread_exit(nullptr);
    196196}
    197197
     
    422422
    423423        for(unsigned long i = 0; i < numOfThreads; ++i){
    424             const int rc = pthread_create(&threads[i], NULL, DoGrep, (void *)&grepEngine);
     424            const int rc = pthread_create(&threads[i], nullptr, DoGrep, (void *)&grepEngine);
    425425            if (rc) {
    426426                llvm::report_fatal_error("Failed to create thread: code " + std::to_string(rc));
  • icGREP/icgrep-devel/icgrep/kernels/cc_kernel.cpp

    r5260 r5267  
    1414using namespace pablo;
    1515using namespace re;
     16using namespace llvm;
    1617
    1718void DirectCharacterClassKernelBuilder::generateDoBlockMethod() const {
  • icGREP/icgrep-devel/icgrep/kernels/cc_kernel.h

    r5246 r5267  
    66#define CC_KERNEL_H
    77
    8 #include "streamset.h"
    9 #include "interface.h"
    10 #include "kernel.h"
    11 #include <pablo/pablo_kernel.h>
    12 
    13 namespace re {
    14     class CC;
    15 }
     8#include <pablo/pablo_kernel.h>  // for PabloKernel
     9#include "kernel.h"              // for KernelBuilder
     10#include <vector>                // for vector
     11#include <string>                // for string
     12namespace IDISA { class IDISA_Builder; }
     13namespace re { class CC; }
    1614
    1715namespace kernel {
     
    2321   
    2422    DirectCharacterClassKernelBuilder(IDISA::IDISA_Builder * iBuilder, std::string ccSetName, std::vector<re::CC *> charClasses, unsigned codeUnitSize)
    25     : KernelBuilder(iBuilder, "cc",
     23    : KernelBuilder(iBuilder, std::move(ccSetName),
    2624                  {Binding{iBuilder->getStreamSetTy(1, 8 * codeUnitSize), "codeUnitStream"}},
    2725                  {Binding{iBuilder->getStreamSetTy(charClasses.size(), 1), "ccStream"}},
  • icGREP/icgrep-devel/icgrep/kernels/deletion.h

    r5260 r5267  
    66#define DELETION_H
    77
    8 #include "streamset.h"
    9 #include "interface.h"
    108#include "kernel.h"
    11 
    12 
    13 namespace llvm { class Module; class Value;}
    14 
    159namespace IDISA { class IDISA_Builder; }
    1610
     
    2519// algorithm.
    2620//
    27 
    28 using namespace parabix;
    2921
    3022namespace kernel {
     
    4234
    4335private:
    44     unsigned mDeletionFieldWidth;
    45     unsigned mStreamCount;
     36    const unsigned mDeletionFieldWidth;
     37    const unsigned mStreamCount;
    4638};
    4739
  • icGREP/icgrep-devel/icgrep/kernels/interface.cpp

    r5263 r5267  
    1616using namespace llvm;
    1717
    18 void KernelInterface::addKernelDeclarations(Module * client) {
     18void KernelInterface::addKernelDeclarations(Module * client) const {
    1919    Module * saveModule = iBuilder->getModule();
    2020    auto savePoint = iBuilder->saveIP();
  • icGREP/icgrep-devel/icgrep/kernels/interface.h

    r5263 r5267  
    4040     */
    4141   
    42     std::string getName() const { return mKernelName;}
     42    const std::string & getName() const { return mKernelName;}
    4343       
    44     std::vector<Binding> getStreamInputs() {return mStreamSetInputs;}
    45     std::vector<Binding> getStreamOutputs() {return mStreamSetOutputs;}
    46     std::vector<Binding> getScalarInputs() { return mScalarInputs;}
    47     std::vector<Binding> getScalarOutputs() { return mScalarOutputs;}
     44    const std::vector<Binding> & getStreamInputs() const {return mStreamSetInputs;}
     45    const std::vector<Binding> & getStreamOutputs() const {return mStreamSetOutputs;}
     46    const std::vector<Binding> & getScalarInputs() const { return mScalarInputs;}
     47    const std::vector<Binding> & getScalarOutputs() const { return mScalarOutputs;}
    4848   
    4949   
    5050    // Add ExternalLinkage method declarations for the kernel to a given client module.
    51     void addKernelDeclarations(llvm::Module * client);
     51    void addKernelDeclarations(llvm::Module * client) const;
    5252    virtual void createInstance() = 0;
    5353    void setInitialArguments(std::vector<llvm::Value *> args);
     
    7979
    8080    KernelInterface(IDISA::IDISA_Builder * builder,
    81                     std::string kernelName,
     81                    std::string && kernelName,
    8282                    std::vector<Binding> stream_inputs,
    8383                    std::vector<Binding> stream_outputs,
    8484                    std::vector<Binding> scalar_inputs,
    8585                    std::vector<Binding> scalar_outputs,
    86                     std::vector<Binding> internal_scalars) :
    87     iBuilder(builder),
    88     mKernelName(kernelName),
    89     mStreamSetInputs(stream_inputs),
    90     mStreamSetOutputs(stream_outputs),
    91     mScalarInputs(scalar_inputs),
    92     mScalarOutputs(scalar_outputs),
    93     mInternalScalars(internal_scalars),
    94     mKernelStateType(nullptr),
    95     mKernelInstance(nullptr),
    96     mLookAheadPositions(0) {}
     86                    std::vector<Binding> internal_scalars)
     87    : iBuilder(builder)
     88    , mKernelName(kernelName)
     89    , mStreamSetInputs(stream_inputs)
     90    , mStreamSetOutputs(stream_outputs)
     91    , mScalarInputs(scalar_inputs)
     92    , mScalarOutputs(scalar_outputs)
     93    , mInternalScalars(internal_scalars)
     94    , mKernelStateType(nullptr)
     95    , mKernelInstance(nullptr)
     96    , mLookAheadPositions(0) {
     97
     98    }
    9799   
    98100protected:
    99101   
    100102    IDISA::IDISA_Builder * const iBuilder;
    101     std::string mKernelName;
     103    const std::string mKernelName;
    102104    std::vector<llvm::Value *> mInitialArguments;
    103105    std::vector<Binding> mStreamSetInputs;
  • icGREP/icgrep-devel/icgrep/kernels/kernel.cpp

    r5266 r5267  
    88#include <llvm/Support/ErrorHandling.h>  // for report_fatal_error
    99#include <toolchain.h>                   // for BufferSegments, SegmentSize
    10 #include "IR_Gen/idisa_builder.h"        // for IDISA_Builder
    11 #include "kernels/streamset.h"           // for StreamSetBuffer
    12 #include "llvm/ADT/StringRef.h"          // for StringRef, operator==
    13 #include "llvm/IR/CallingConv.h"         // for ::C
    14 #include "llvm/IR/Constant.h"            // for Constant
    15 #include "llvm/IR/Constants.h"           // for ConstantInt
    16 #include "llvm/IR/Function.h"            // for Function, Function::arg_iter...
    17 #include "llvm/IR/Instructions.h"        // for LoadInst (ptr only), PHINode
    18 #include "llvm/Support/Compiler.h"       // for LLVM_UNLIKELY
     10#include <kernels/streamset.h>           // for StreamSetBuffer
     11#include <llvm/ADT/StringRef.h>          // for StringRef, operator==
     12#include <llvm/IR/CallingConv.h>         // for ::C
     13#include <llvm/IR/Constant.h>            // for Constant
     14#include <llvm/IR/Constants.h>           // for ConstantInt
     15#include <llvm/IR/Function.h>            // for Function, Function::arg_iter...
     16#include <llvm/IR/Instructions.h>        // for LoadInst (ptr only), PHINode
     17#include <llvm/IR/Module.h>
     18#include <llvm/Support/Compiler.h>       // for LLVM_UNLIKELY
     19#include <llvm/Support/raw_ostream.h>
    1920namespace llvm { class BasicBlock; }
    20 namespace llvm { class Module; }
    2121namespace llvm { class Type; }
    2222
     
    2626
    2727KernelBuilder::KernelBuilder(IDISA::IDISA_Builder * builder,
    28                              std::string kernelName,
     28                             std::string && kernelName,
    2929                             std::vector<Binding> stream_inputs,
    3030                             std::vector<Binding> stream_outputs,
     
    3232                             std::vector<Binding> scalar_outputs,
    3333                             std::vector<Binding> internal_scalars)
    34 : KernelInterface(builder, kernelName, stream_inputs, stream_outputs, scalar_parameters, scalar_outputs, internal_scalars),
    35 mNoTerminateAttribute(false),
    36 mDoBlockUpdatesProducedItemCountsAttribute(false) {
     34: KernelInterface(builder, std::move(kernelName), stream_inputs, stream_outputs, scalar_parameters, scalar_outputs, internal_scalars)
     35, mNoTerminateAttribute(false)
     36, mDoBlockUpdatesProducedItemCountsAttribute(false) {
    3737
    3838}
     
    442442    Module * m = iBuilder->getModule();
    443443    Type * const voidTy = iBuilder->getVoidTy();
    444     Type * const voidPtrTy = iBuilder->getVoidPtrTy();
    445     Type * const int8PtrTy = iBuilder->getInt8PtrTy();
    446     Type * const int1ty = iBuilder->getInt1Ty();
     444    PointerType * const voidPtrTy = iBuilder->getVoidPtrTy();
     445    PointerType * const int8PtrTy = iBuilder->getInt8PtrTy();
     446    IntegerType * const int1ty = iBuilder->getInt1Ty();
    447447   
    448448    Function * const threadFunc = cast<Function>(m->getOrInsertFunction(name, voidTy, int8PtrTy, nullptr));
  • icGREP/icgrep-devel/icgrep/kernels/kernel.h

    r5266 r5267  
    9191    // Constructor
    9292    KernelBuilder(IDISA::IDISA_Builder * builder,
    93                     std::string kernelName,
     93                    std::string && kernelName,
    9494                    std::vector<Binding> stream_inputs,
    9595                    std::vector<Binding> stream_outputs,
  • icGREP/icgrep-devel/icgrep/kernels/mmap_kernel.cpp

    r5266 r5267  
    5656
    5757
    58 MMapSourceKernel::MMapSourceKernel(IDISA::IDISA_Builder * iBuilder, unsigned blocksPerSegment, unsigned codeUnitWidth) :
    59 KernelBuilder(iBuilder, "mmap_source",
    60               {}, {Binding{iBuilder->getStreamSetTy(1, codeUnitWidth), "sourceBuffer"}},
    61               {Binding{iBuilder->getSizeTy(), "fileSize"}}, {}, {})
     58MMapSourceKernel::MMapSourceKernel(IDISA::IDISA_Builder * iBuilder, unsigned blocksPerSegment, unsigned codeUnitWidth)
     59: KernelBuilder(iBuilder, "mmap_source", {}, {Binding{iBuilder->getStreamSetTy(1, codeUnitWidth), "sourceBuffer"}}, {Binding{iBuilder->getSizeTy(), "fileSize"}}, {}, {})
    6260, mSegmentBlocks(blocksPerSegment)
    6361, mCodeUnitWidth(codeUnitWidth) {
  • icGREP/icgrep-devel/icgrep/kernels/mmap_kernel.h

    r5265 r5267  
    2020   
    2121private:
    22     unsigned mSegmentBlocks;
    23     unsigned mCodeUnitWidth;
    24  
     22
    2523    void generateDoSegmentMethod() const override;
     24
     25private:
     26    const unsigned mSegmentBlocks;
     27    const unsigned mCodeUnitWidth;
    2628   
    2729};
  • icGREP/icgrep-devel/icgrep/kernels/p2s_kernel.cpp

    r5261 r5267  
    11#include "p2s_kernel.h"
    2 #include "kernels/kernel.h"
    3 #include "IR_Gen/idisa_builder.h"
    4 #include <llvm/IR/Type.h>
     2#include "IR_Gen/idisa_builder.h"  // for IDISA_Builder
     3#include "llvm/IR/Constant.h"      // for Constant
     4#include "llvm/IR/Constants.h"     // for ConstantInt
     5#include "llvm/IR/DerivedTypes.h"  // for PointerType, VectorType
     6#include "llvm/IR/Function.h"      // for Function, Function::arg_iterator
    57#include <llvm/IR/Module.h>
    6 #include <iostream>
    7 #include <stdint.h>
    8 #include <llvm/Support/FileSystem.h>
    9 #include <llvm/Support/raw_ostream.h>
     8#include <kernels/streamset.h>
     9namespace llvm { class Value; }
    1010
    1111using namespace llvm;
     
    116116}
    117117   
    118 P2SKernelWithCompressedOutput::P2SKernelWithCompressedOutput(IDISA::IDISA_Builder * iBuilder) :
    119     KernelBuilder(iBuilder, "p2s_compress",
    120                   {Binding{iBuilder->getStreamSetTy(8, 1), "basisBits"}, Binding{iBuilder->getStreamSetTy(1, 1), "deletionCounts"}},
    121                   {Binding{iBuilder->getStreamSetTy(1, 8), "byteStream"}},
    122                   {}, {}, {}) {
    123         setDoBlockUpdatesProducedItemCountsAttribute(true);
    124 
    125     }
     118P2SKernelWithCompressedOutput::P2SKernelWithCompressedOutput(IDISA::IDISA_Builder * iBuilder)
     119: KernelBuilder(iBuilder, "p2s_compress",
     120              {Binding{iBuilder->getStreamSetTy(8, 1), "basisBits"}, Binding{iBuilder->getStreamSetTy(1, 1), "deletionCounts"}},
     121              {Binding{iBuilder->getStreamSetTy(1, 8), "byteStream"}},
     122              {}, {}, {}) {
     123    setDoBlockUpdatesProducedItemCountsAttribute(true);
     124}
    126125   
    127126   
     
    178177    auto savePoint = iBuilder->saveIP();
    179178    Module * m = iBuilder->getModule();
    180     Type * i32 = iBuilder->getIntNTy(32);
    181     Type * bitBlockPtrTy = llvm::PointerType::get(iBuilder->getBitBlockType(), 0);
     179    Type * i32Ty = iBuilder->getInt32Ty();
     180    Type * bitBlockPtrTy = iBuilder->getBitBlockType()->getPointerTo();
    182181
    183182    Function * doBlockFunction = m->getFunction(mKernelName + doBlock_suffix);
     
    212211    Value * i16BlockNo = iBuilder->CreateUDiv(i16UnitsGenerated, stride);
    213212    Value * u16_output_ptr = getStreamView(int16PtrTy, self, "i16Stream", i16BlockNo, iBuilder->CreateURem(i16UnitsGenerated, stride));
    214     Value * offset = ConstantInt::get(i32, 0);
     213    Value * offset = ConstantInt::get(i32Ty, 0);
    215214    for (unsigned j = 0; j < 8; ++j) {
    216215        Value * merge0 = iBuilder->bitCast(iBuilder->esimd_mergel(8, hi_bytes[j], lo_bytes[j]));
    217216        Value * merge1 = iBuilder->bitCast(iBuilder->esimd_mergeh(8, hi_bytes[j], lo_bytes[j]));
    218217        iBuilder->CreateAlignedStore(merge0, iBuilder->CreateBitCast(iBuilder->CreateGEP(u16_output_ptr, offset), bitBlockPtrTy), 1);
    219         offset = iBuilder->CreateZExt(iBuilder->CreateExtractElement(unit_counts, iBuilder->getInt32(2 * j)), i32);
     218        offset = iBuilder->CreateZExt(iBuilder->CreateExtractElement(unit_counts, iBuilder->getInt32(2 * j)), i32Ty);
    220219        iBuilder->CreateAlignedStore(merge1, iBuilder->CreateBitCast(iBuilder->CreateGEP(u16_output_ptr, offset), bitBlockPtrTy), 1);
    221         offset = iBuilder->CreateZExt(iBuilder->CreateExtractElement(unit_counts, iBuilder->getInt32(2 * j + 1)), i32);
     220        offset = iBuilder->CreateZExt(iBuilder->CreateExtractElement(unit_counts, iBuilder->getInt32(2 * j + 1)), i32Ty);
    222221    }
    223222    i16UnitsGenerated = iBuilder->CreateAdd(i16UnitsGenerated, iBuilder->CreateZExt(offset, iBuilder->getSizeTy()));
  • icGREP/icgrep-devel/icgrep/kernels/p2s_kernel.h

    r5261 r5267  
    66#define P2S_KERNEL_H
    77
    8 #include "streamset.h"
    9 #include "interface.h"
    10 #include "kernel.h"
    11 
    12 namespace llvm { class Module; }
    13 
     8#include "kernel.h"  // for KernelBuilder
    149namespace IDISA { class IDISA_Builder; }
    1510
  • icGREP/icgrep-devel/icgrep/kernels/pipeline.cpp

    r5266 r5267  
    66#include "pipeline.h"
    77#include <toolchain.h>
    8 #include <IR_Gen/idisa_builder.h>
    9 #include <kernels/interface.h>
    108#include <kernels/kernel.h>
    11 #include <iostream>
     9#include <llvm/IR/Module.h>
    1210#include <unordered_map>
    1311
     
    8179    Type * const size_ty = iBuilder->getSizeTy();
    8280    Type * const voidTy = iBuilder->getVoidTy();
    83     Type * const voidPtrTy = iBuilder->getVoidPtrTy();
    84     Type * const int8PtrTy = iBuilder->getInt8PtrTy();
     81    PointerType * const voidPtrTy = iBuilder->getVoidPtrTy();
     82    PointerType * const int8PtrTy = iBuilder->getInt8PtrTy();
    8583
    8684    Function * const threadFunc = cast<Function>(m->getOrInsertFunction(name, voidTy, int8PtrTy, nullptr));
     
    185183    Module * m = iBuilder->getModule();
    186184   
    187     Type * const size_ty = iBuilder->getSizeTy();
    188     Type * const voidPtrTy = iBuilder->getVoidPtrTy();
    189     Type * const int8PtrTy = iBuilder->getInt8PtrTy();
     185    IntegerType * const size_ty = iBuilder->getSizeTy();
     186    PointerType * const voidPtrTy = iBuilder->getVoidPtrTy();
     187    PointerType * const int8PtrTy = iBuilder->getInt8PtrTy();
    190188   
    191189    for (auto k : kernels) k->createInstance();
     
    238236void generatePipelineParallel(IDISA::IDISA_Builder * iBuilder, const std::vector<KernelBuilder *> & kernels) {
    239237   
    240     Type * pthreadTy = iBuilder->getSizeTy();
    241     Type * const voidPtrTy = iBuilder->getVoidPtrTy();
    242     Type * const int8PtrTy = iBuilder->getInt8PtrTy();
    243    
    244     Type * const pthreadsTy = ArrayType::get(pthreadTy, kernels.size());
     238    IntegerType * pthreadTy = iBuilder->getSizeTy();
     239    PointerType * const voidPtrTy = iBuilder->getVoidPtrTy();
     240    PointerType * const int8PtrTy = iBuilder->getInt8PtrTy();
     241   
     242    ArrayType * const pthreadsTy = ArrayType::get(pthreadTy, kernels.size());
    245243   
    246244    for (auto k : kernels) k->createInstance();
  • icGREP/icgrep-devel/icgrep/kernels/radix64.cpp

    r5261 r5267  
    44 */
    55#include "radix64.h"
    6 //#include "expand3_4.h"
    7 #include <kernels/kernel.h>
     6#include <kernels/streamset.h>
    87#include <IR_Gen/idisa_builder.h>
    98#include <llvm/IR/Module.h>
  • icGREP/icgrep-devel/icgrep/kernels/radix64.h

    r5261 r5267  
    66#define RADIX64_H
    77
    8 #include "streamset.h"
    9 #include "interface.h"
    108#include "kernel.h"
    119
  • icGREP/icgrep-devel/icgrep/kernels/s2p_kernel.h

    r5260 r5267  
    2626};
    2727
    28    
    29 
    3028}
    3129#endif
  • icGREP/icgrep-devel/icgrep/kernels/scanmatchgen.cpp

    r5260 r5267  
    44 */
    55
    6 #include "kernel.h"
    76#include "scanmatchgen.h"
    87#include <llvm/IR/Intrinsics.h>
    98#include <IR_Gen/idisa_builder.h>
    109#include <llvm/IR/Module.h>
    11 #include <llvm/Support/raw_os_ostream.h>
    1210
    1311using namespace llvm;
  • icGREP/icgrep-devel/icgrep/kernels/scanmatchgen.h

    r5246 r5267  
    66#define SCANMATCHGEN_H
    77
    8 #include "streamset.h"
    9 #include "kernel.h"
    10 #include "grep_type.h"
    11 #include <llvm/Support/Host.h>
    12 #include <llvm/ADT/Triple.h>
    13 
    14 namespace llvm { class Module; class Function;}
    15 
    16 namespace IDISA { class IDISA_Builder; }
     8#include "grep_type.h"  // for GrepType
     9#include "kernel.h"     // for KernelBuilder
     10namespace IDISA { class IDISA_Builder; }  // lines 16-16
     11namespace llvm { class Function; }  // lines 14-14
     12namespace llvm { class Module; }  // lines 14-14
    1713
    1814namespace kernel {
     
    3127       
    3228private:
     29
    3330    void generateDoBlockMethod() const override;
     31
    3432    llvm::Function * generateScanWordRoutine(llvm::Module * m) const;
    35        
     33
     34private:
    3635    GrepType mGrepType;
    3736};
  • icGREP/icgrep-devel/icgrep/kernels/stdout_kernel.cpp

    r5265 r5267  
    66#include <llvm/IR/Module.h>
    77#include <IR_Gen/idisa_builder.h>
     8#include <kernels/streamset.h>
     9// #include <llvm/IR/Type.h>
     10namespace llvm { class Type; }
    811
    912using namespace llvm;
     
    2730    /* unused Value * doFinal = &*(args++);*/ args++;
    2831    Value * producerPos = &*(args++);
    29     ////iBuilder->CallPrintInt("blocksToDo", blocksToDo);
    3032    Value * streamStructPtr = getStreamSetStructPtr(self, "codeUnitBuffer");
    31     //iBuilder->CallPrintInt("streamStructPtr", iBuilder->CreatePtrToInt(streamStructPtr, iBuilder->getInt64Ty()));
    32 
    33     //iBuilder->CallPrintInt("producerPos", producerPos);
    3433    Value * processed = getProcessedItemCount(self, "codeUnitBuffer");
    3534    Value * itemsToDo = iBuilder->CreateSub(producerPos, processed);
     
    4948}
    5049
     50StdOutKernel::StdOutKernel(IDISA::IDISA_Builder * iBuilder, unsigned codeUnitWidth)
     51: KernelBuilder(iBuilder, "stdout", {Binding{iBuilder->getStreamSetTy(1, codeUnitWidth), "codeUnitBuffer"}}, {}, {}, {}, {})
     52, mCodeUnitWidth(codeUnitWidth) {
     53    setNoTerminateAttribute(true);
    5154}
     55
     56}
  • icGREP/icgrep-devel/icgrep/kernels/stdout_kernel.h

    r5265 r5267  
    66#define STDOUT_KERNEL_H
    77
    8 #include "streamset.h"
    98#include "kernel.h"
    10 #include <llvm/IR/Type.h>
    119
    1210namespace IDISA { class IDISA_Builder; }
     
    1614class StdOutKernel : public KernelBuilder {
    1715public:
    18     StdOutKernel(IDISA::IDISA_Builder * iBuilder, unsigned codeUnitWidth) :
    19     KernelBuilder(iBuilder, "stdout",
    20                   {Binding{iBuilder->getStreamSetTy(1, codeUnitWidth), "codeUnitBuffer"}}, {}, {}, {}, {}),
    21     mCodeUnitWidth(codeUnitWidth) {
    22         setNoTerminateAttribute(true);
    23     }
     16
     17    StdOutKernel(IDISA::IDISA_Builder * iBuilder, unsigned codeUnitWidth);
    2418   
    2519private:
    26     unsigned mCodeUnitWidth;
    2720 
    2821    void generateDoSegmentMethod() const override;
     22
     23private:
     24    const unsigned mCodeUnitWidth;
    2925   
    3026};
  • icGREP/icgrep-devel/icgrep/object_cache.cpp

    r4964 r5267  
    55#include <llvm/Support/FileSystem.h>
    66#include <llvm/Support/Path.h>
    7 
     7#include <llvm/IR/Module.h>
    88#ifdef OBJECT_CACHE_DEBUG
    99#include <iostream>
  • icGREP/icgrep-devel/icgrep/object_cache.h

    r5260 r5267  
    44#include <llvm/ADT/SmallString.h>
    55#include <llvm/ExecutionEngine/ObjectCache.h>
    6 #include <llvm/IR/Module.h>
    76#include <llvm/Support/MemoryBuffer.h>
    87#include <string>
     8namespace llvm { class Module; }
    99
    1010class ICGrepObjectCache : public llvm::ObjectCache {
  • icGREP/icgrep-devel/icgrep/pablo/analysis/pabloverifier.cpp

    r5233 r5267  
    11#include "pabloverifier.hpp"
     2#include <pablo/branch.h>
     3#include <pablo/pe_var.h>
     4#include <pablo/ps_assign.h>
     5#include <pablo/codegenstate.h>
    26#include <pablo/pablo_kernel.h>
    3 #include <pablo/codegenstate.h>
    47#include <pablo/printer_pablos.h>
    5 #include <iostream>
    68#include <boost/container/flat_set.hpp>
    7 #include <queue>
    8 
     9#include <llvm/Support/raw_ostream.h>
     10
     11using namespace llvm;
    912
    1013namespace pablo {
     
    197200    switch (op->getClassTypeId()) {
    198201        case TypeId::Block:
    199         case TypeId::Function:
    200         case TypeId::Prototype:
    201202        case TypeId::Assign:
    202         case TypeId::Call:
    203         case TypeId::SetIthBit:
    204203        case TypeId::If:
    205204        case TypeId::While:
     
    382381        isTopologicallyOrdered(kernel);
    383382    } catch(std::runtime_error & err) {
    384         raw_os_ostream out(std::cerr);
    385         PabloPrinter::print(kernel, out);
    386         out.flush();
     383        PabloPrinter::print(kernel, errs());
     384        errs().flush();
    387385        if (location.empty()) {
    388386            llvm::report_fatal_error(err.what());
  • icGREP/icgrep-devel/icgrep/pablo/arithmetic.h

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

    r5230 r5267  
    1717    virtual ~And() { }
    1818protected:
    19     And(Type * const type, PabloAST * expr1, PabloAST * expr2, const String * name, Allocator & allocator)
     19    And(llvm::Type * const type, PabloAST * expr1, PabloAST * expr2, const String * name, Allocator & allocator)
    2020    : Variadic(ClassTypeId::And, type, {expr1, expr2}, name, allocator)
    2121    {
    2222
    2323    }
    24     And(Type * const type, const unsigned reserved, const String * name, Allocator & allocator)
     24    And(llvm::Type * const type, const unsigned reserved, const String * name, Allocator & allocator)
    2525    : Variadic(ClassTypeId::And, type, reserved, name, allocator)
    2626    {
     
    2828    }
    2929    template<typename iterator>
    30     And(Type * const type, iterator begin, iterator end, const String * name, Allocator & allocator)
     30    And(llvm::Type * const type, iterator begin, iterator end, const String * name, Allocator & allocator)
    3131    : Variadic(ClassTypeId::And, type, begin, end, name, allocator) {
    3232
     
    4545    virtual ~Or() { }
    4646protected:
    47     Or(Type * const type, PabloAST * expr1, PabloAST * expr2, const String * name, Allocator & allocator)
     47    Or(llvm::Type * const type, PabloAST * expr1, PabloAST * expr2, const String * name, Allocator & allocator)
    4848    : Variadic(ClassTypeId::Or, type, {expr1, expr2}, name, allocator)
    4949    {
    5050
    5151    }
    52     Or(Type * const type, const unsigned reserved, const String * name, Allocator & allocator)
     52    Or(llvm::Type * const type, const unsigned reserved, const String * name, Allocator & allocator)
    5353    : Variadic(ClassTypeId::Or, type, reserved, name, allocator)
    5454    {
     
    5656    }
    5757    template<typename iterator>
    58     Or(Type * const type, iterator begin, iterator end, const String * name, Allocator & allocator)
     58    Or(llvm::Type * const type, iterator begin, iterator end, const String * name, Allocator & allocator)
    5959    : Variadic(ClassTypeId::Or, type, begin, end, name, allocator) {
    6060
     
    7272    }
    7373protected:
    74     Xor(Type * const type, PabloAST * expr1, PabloAST * expr2, const String * name, Allocator & allocator)
     74    Xor(llvm::Type * const type, PabloAST * expr1, PabloAST * expr2, const String * name, Allocator & allocator)
    7575    : Variadic(ClassTypeId::Xor, type, {expr1, expr2}, name, allocator)
    7676    {
    7777
    7878    }
    79     Xor(Type * const type, const unsigned reserved, const String * name, Allocator & allocator)
     79    Xor(llvm::Type * const type, const unsigned reserved, const String * name, Allocator & allocator)
    8080    : Variadic(ClassTypeId::Xor, type, reserved, name, allocator)
    8181    {
     
    8383    }
    8484    template<typename iterator>
    85     Xor(Type * const type, iterator begin, iterator end, const String * name, Allocator & allocator)
     85    Xor(llvm::Type * const type, iterator begin, iterator end, const String * name, Allocator & allocator)
    8686    : Variadic(ClassTypeId::Xor, type, begin, end, name, allocator) {
    8787
  • icGREP/icgrep-devel/icgrep/pablo/branch.cpp

    r5230 r5267  
    1 #include <pablo/branch.h>
     1#include "branch.h"
    22#include <pablo/codegenstate.h>
    3 #include <pablo/printer_pablos.h>
     3#include <pablo/pe_var.h>
     4#include <pablo/ps_assign.h>
     5
     6using namespace llvm;
    47
    58namespace pablo {
  • icGREP/icgrep-devel/icgrep/pablo/branch.h

    r5230 r5267  
    33
    44#include <pablo/pabloAST.h>
    5 #include <vector>
     5namespace pablo { class Var; }
     6namespace pablo { class PabloBlock; }
    67
    78namespace pablo {
    8 
    9 class Var;
    109
    1110class Branch : public Statement {
     
    4443    Branch(const ClassTypeId typeId, PabloAST * condition, PabloBlock * body, Allocator & allocator);
    4544protected:
    46     PabloBlock *            mBody;
     45    PabloBlock * mBody;
    4746};
    4847
  • icGREP/icgrep-devel/icgrep/pablo/builder.cpp

    r5227 r5267  
    1 #include <pablo/builder.hpp>
    2 // #include <boost/current_function.hpp> // BOOST_CURRENT_FUNCTION
     1#include "builder.hpp"
     2#include <pablo/boolean.h>
     3#include <pablo/arithmetic.h>
     4#include <pablo/branch.h>
     5#include <pablo/pe_advance.h>
     6#include <pablo/pe_lookahead.h>
     7#include <pablo/pe_matchstar.h>
     8#include <pablo/pe_scanthru.h>
     9#include <pablo/pe_infile.h>
     10#include <pablo/pe_count.h>
     11#include <pablo/pe_integer.h>
     12#include <pablo/pe_string.h>
     13#include <pablo/pe_zeroes.h>
     14#include <pablo/pe_ones.h>
     15#include <pablo/pe_var.h>
     16#include <pablo/ps_assign.h>
     17
     18using namespace llvm;
    319
    420namespace pablo {
     
    100116
    101117using TypeId = PabloAST::ClassTypeId;
    102 
    103 Call * PabloBuilder::createCall(Prototype * prototype, const std::vector<PabloAST *> & args) {
    104     if (prototype == nullptr) {
    105         throw std::runtime_error("Call object cannot be created with a Null prototype!");
    106     }
    107     if (args.size() != cast<Prototype>(prototype)->getNumOfParameters()) {
    108         throw std::runtime_error("Invalid number of arguments passed into Call object!");
    109     }
    110     MAKE_VARIABLE(createCall, TypeId::Call, prototype->getName(), args, prototype);
    111     return cast<Call>(result);
    112 }
    113118
    114119PabloAST * PabloBuilder::createAdvance(PabloAST * expr, PabloAST * shiftAmount) {
  • icGREP/icgrep-devel/icgrep/pablo/builder.hpp

    r5245 r5267  
    44#include <pablo/codegenstate.h>
    55#include <pablo/expression_map.hpp>
     6#include <pablo/pe_var.h>
    67
    78namespace pablo {
     
    5758    }
    5859
    59     inline Zeroes * createZeroes(Type * const type = nullptr) {
     60    inline Zeroes * createZeroes(llvm::Type * const type = nullptr) {
    6061        return mPb->createZeroes(type);
    6162    }
    6263
    63     inline Ones * createOnes(Type * const type = nullptr) {
     64    inline Ones * createOnes(llvm::Type * const type = nullptr) {
    6465        return mPb->createOnes(type);
    6566    }
    6667
    67     inline Var * createVar(const std::string name, Type * const type = nullptr) {
     68    inline Var * createVar(const std::string name, llvm::Type * const type = nullptr) {
    6869        return createVar(makeName(name), type);
    6970    }
     
    7576    }
    7677
    77     inline Var * createVar(String * const name, Type * const type = nullptr) {
     78    inline Var * createVar(String * const name, llvm::Type * const type = nullptr) {
    7879        return mPb->createVar(name, type);
    7980    }
     
    9091        return createExtract(value, getInteger(index), prefix);
    9192    }
    92 
    93     inline Call * createCall(Prototype * prototype, const std::vector<Var *> & args) {
    94         return createCall(prototype, reinterpret_cast<const std::vector<PabloAST *> &>(args));
    95     }
    96 
    97     Call * createCall(Prototype * prototype, const std::vector<PabloAST *> &vars);
    9893
    9994    inline PabloAST * createAdvance(PabloAST * expr, const int64_t shiftAmount) {
     
    199194    }
    200195
    201     Type * getStreamTy(const unsigned FieldWidth = 1) {
     196    llvm::Type * getStreamTy(const unsigned FieldWidth = 1) {
    202197        return mPb->getStreamTy(FieldWidth);
    203198    }
    204199   
    205     Type * getStreamSetTy(const unsigned NumElements = 1, const unsigned FieldWidth = 1) {
     200    llvm::Type * getStreamSetTy(const unsigned NumElements = 1, const unsigned FieldWidth = 1) {
    206201        return mPb->getStreamSetTy(NumElements, FieldWidth);
    207202    }
     
    265260    }
    266261
    267     inline void print(raw_ostream & O, const bool expandNested = true) const {
     262    inline void print(llvm::raw_ostream & O, const bool expandNested = true) const {
    268263        mPb->print(O, expandNested);
    269264    }
  • icGREP/icgrep-devel/icgrep/pablo/carry_data.h

    r5227 r5267  
    77#ifndef CARRY_DATA_H
    88#define CARRY_DATA_H
    9 
    10 #include <stdexcept>
    11 #include <iostream>
    12 #include <ostream>
    13 #include <llvm/Support/raw_os_ostream.h>
    14 #include <llvm/IR/Module.h>
    159
    1610/*
     
    2620
    2721namespace pablo {
    28 
    29 class PabloBlock;
    30 class Statement;
    3122
    3223class CarryData {
  • icGREP/icgrep-devel/icgrep/pablo/carry_manager.cpp

    r5246 r5267  
    55 */
    66
    7 #include <stdexcept>
     7#include "carry_manager.h"
    88#include <pablo/carry_data.h>
    99#include <pablo/codegenstate.h>
    10 #include <pablo/carry_manager.h>
    11 #include <pablo/pabloAST.h>
    12 #include <llvm/Support/CommandLine.h>
    1310#include <llvm/IR/BasicBlock.h>
    14 #include <llvm/IR/CallingConv.h>
    15 #include <llvm/IR/Function.h>
    16 #include <pablo/printer_pablos.h>
     11#include <IR_Gen/idisa_builder.h>
     12#include <llvm/IR/DerivedTypes.h>
     13#include <pablo/branch.h>
     14#include <pablo/pe_advance.h>
     15#include <pablo/pe_scanthru.h>
     16#include <pablo/pe_matchstar.h>
     17#include <pablo/pe_var.h>
     18
     19using namespace llvm;
    1720
    1821namespace pablo {
     
    600603}
    601604
    602 }
    603 
     605/** ------------------------------------------------------------------------------------------------------------- *
     606 * @brief constructor
     607 ** ------------------------------------------------------------------------------------------------------------- */
     608CarryManager::CarryManager(IDISA::IDISA_Builder * idb) noexcept
     609: iBuilder(idb)
     610, mKernel(nullptr)
     611, mSelf(nullptr)
     612, mFunction(nullptr)
     613, mBitBlockType(idb->getBitBlockType())
     614, mBitBlockWidth(idb->getBitBlockWidth())
     615, mCurrentFrameIndex(0)
     616, mCurrentScope(nullptr)
     617, mCarryInfo(nullptr)
     618, mCarryPackType(mBitBlockType)
     619, mCarryPackPtr(nullptr)
     620, mIfDepth(0)
     621, mLoopDepth(0) {
     622
     623}
     624
     625
     626}
     627
  • icGREP/icgrep-devel/icgrep/pablo/carry_manager.h

    r5238 r5267  
    77#ifndef CARRY_MANAGER_H
    88#define CARRY_MANAGER_H
    9 #include <llvm/IR/IRBuilder.h>
    10 #include <llvm/IR/Module.h>
    11 #include <IR_Gen/idisa_builder.h>
    12 #include <pablo/pablo_kernel.h>
    13 #include <pablo/codegenstate.h>
     9
    1410#include <pablo/carry_data.h>
    15 #include <llvm/IR/Constants.h>
    16 #include <kernels/kernel.h>
     11#include <vector>
     12namespace IDISA { class IDISA_Builder; }
     13namespace llvm { class BasicBlock; }
     14namespace llvm { class Function; }
     15namespace llvm { class PHINode; }
     16namespace llvm { class StructType; }
     17namespace llvm { class Type; }
     18namespace llvm { class Value; }
     19namespace pablo { class Advance; }
     20namespace pablo { class PabloBlock; }
     21namespace pablo { class PabloKernel; }
     22namespace pablo { class Statement; }
     23
    1724
    1825/*
     
    2734*/
    2835
    29 using namespace llvm;
    30 
    3136namespace pablo {
    32 
    33 class PabloBlock;
    34 
    35 
    3637
    3738class CarryManager {
     
    4142public:
    4243 
    43     explicit CarryManager(IDISA::IDISA_Builder * idb) noexcept
    44     : iBuilder(idb)
    45     , mKernel(nullptr)
    46     , mSelf(nullptr)
    47     , mFunction(nullptr)
    48     , mBitBlockType(idb->getBitBlockType())
    49     , mBitBlockWidth(idb->getBitBlockWidth())
    50     , mCurrentFrameIndex(0)
    51     , mCurrentScope(nullptr)
    52     , mCarryInfo(nullptr)
    53     , mCarryPackType(mBitBlockType)
    54     , mCarryPackPtr(nullptr)
    55     , mIfDepth(0)
    56     , mLoopDepth(0) {
    57 
    58     }
    59 
    60     ~CarryManager() {
    61 
    62     }
     44    explicit CarryManager(IDISA::IDISA_Builder * idb) noexcept;
    6345
    6446    void initializeCarryData(PabloKernel * const kernel);
    6547
    66     void initializeCodeGen(Value * const self, Function *function);
     48    void initializeCodeGen(llvm::Value * const self, llvm::Function *function);
    6749
    6850    /* Entering and leaving loops. */
     
    7052    void enterLoopScope(PabloBlock * const scope);
    7153
    72     void enterLoopBody(BasicBlock * const entryBlock);
     54    void enterLoopBody(llvm::BasicBlock * const entryBlock);
    7355
    74     void leaveLoopBody(BasicBlock * const exitBlock);
     56    void leaveLoopBody(llvm::BasicBlock * const exitBlock);
    7557
    76     void leaveLoopScope(BasicBlock * const entryBlock, BasicBlock * const exitBlock);
     58    void leaveLoopScope(llvm::BasicBlock * const entryBlock, llvm::BasicBlock * const exitBlock);
    7759
    7860    /* Entering and leaving ifs. */
     
    8062    void enterIfScope(PabloBlock * const scope);
    8163
    82     void enterIfBody(BasicBlock * const entryBlock);
     64    void enterIfBody(llvm::BasicBlock * const entryBlock);
    8365
    84     void leaveIfBody(BasicBlock * const exitBlock);
     66    void leaveIfBody(llvm::BasicBlock * const exitBlock);
    8567
    86     void leaveIfScope(BasicBlock * const entryBlock, BasicBlock * const exitBlock);
     68    void leaveIfScope(llvm::BasicBlock * const entryBlock, llvm::BasicBlock * const exitBlock);
    8769
    8870    /* Methods for processing individual carry-generating operations. */
    8971   
    90     Value * addCarryInCarryOut(const Statement * operation, Value * const e1, Value * const e2);
     72    llvm::Value * addCarryInCarryOut(const Statement * operation, llvm::Value * const e1, llvm::Value * const e2);
    9173
    92     Value * advanceCarryInCarryOut(const Advance * advance, Value * const strm);
     74    llvm::Value * advanceCarryInCarryOut(const Advance * advance, llvm::Value * const strm);
    9375 
    9476    /* Methods for getting and setting carry summary values for If statements */
    9577         
    96     Value * generateSummaryTest(Value * condition);
     78    llvm::Value * generateSummaryTest(llvm::Value * condition);
    9779   
    9880protected:
     
    10082    static unsigned enumerate(PabloBlock * const scope, unsigned index = 0);
    10183    static bool requiresVariableLengthMode(const PabloBlock * const scope);
    102     StructType * analyse(PabloBlock * const scope, const unsigned ifDepth = 0, const unsigned whileDepth = 0);
     84    llvm::StructType * analyse(PabloBlock * const scope, const unsigned ifDepth = 0, const unsigned whileDepth = 0);
    10385
    10486    /* Entering and leaving scopes. */
     
    10789
    10890    /* Methods for processing individual carry-generating operations. */
    109     Value * getNextCarryIn();
    110     void setNextCarryOut(Value * const carryOut);
    111     Value * longAdvanceCarryInCarryOut(const unsigned shiftAmount, Value * const value);
     91    llvm::Value * getNextCarryIn();
     92    void setNextCarryOut(llvm::Value * const carryOut);
     93    llvm::Value * longAdvanceCarryInCarryOut(const unsigned shiftAmount, llvm::Value * const value);
    11294
    11395    /* Summary handling routines */
    114     void addToSummary(Value * const value);
     96    void addToSummary(llvm::Value * const value);
    11597
    11698    bool inCollapsingCarryMode() const;
     
    118100private:
    119101
    120     IDISA::IDISA_Builder * const                iBuilder;
    121     PabloKernel *                               mKernel;
    122     Value *                                     mSelf;
    123     Function *                                  mFunction;
    124     Type * const                                mBitBlockType;
    125     const unsigned                              mBitBlockWidth;
     102    IDISA::IDISA_Builder * const                    iBuilder;
     103    PabloKernel *                                   mKernel;
     104    llvm::Value *                                   mSelf;
     105    llvm::Function *                                mFunction;
     106    llvm::Type * const                              mBitBlockType;
     107    const unsigned                                  mBitBlockWidth;
    126108
    127     Value *                                     mCurrentFrame;
    128     unsigned                                    mCurrentFrameIndex;
     109    llvm::Value *                                   mCurrentFrame;
     110    unsigned                                        mCurrentFrameIndex;
    129111
    130     PabloBlock *                                mCurrentScope;
    131     CarryData *                                 mCarryInfo;
     112    PabloBlock *                                    mCurrentScope;
     113    CarryData *                                     mCarryInfo;
    132114
    133     Type *                                      mCarryPackType;
    134     Value *                                     mCarryPackPtr;
     115    llvm::Type *                                    mCarryPackType;
     116    llvm::Value *                                   mCarryPackPtr;
    135117
    136     unsigned                                    mIfDepth;
     118    unsigned                                        mIfDepth;
    137119
    138     unsigned                                    mLoopDepth;   
    139     Value *                                     mLoopSelector;
    140     std::vector<PHINode *>                      mLoopIndicies;
     120    unsigned                                        mLoopDepth;
     121    llvm::Value *                                   mLoopSelector;
     122    std::vector<llvm::PHINode *>                    mLoopIndicies;
    141123
    142     std::vector<CarryData>                      mCarryMetadata;
    143     std::vector<std::pair<Value *, unsigned>>  mCarryFrame;
     124    std::vector<CarryData>                          mCarryMetadata;
     125    std::vector<std::pair<llvm::Value *, unsigned>> mCarryFrame;
    144126
    145     std::vector<Value *>                        mCarrySummary;
     127    std::vector<llvm::Value *>                      mCarrySummary;
    146128};
    147129
  • icGREP/icgrep-devel/icgrep/pablo/codegenstate.cpp

    r5245 r5267  
    55 */
    66
    7 #include <pablo/codegenstate.h>
     7#include "codegenstate.h"
    88#include <pablo/printer_pablos.h>
     9#include <pablo/boolean.h>
     10#include <pablo/arithmetic.h>
     11#include <pablo/branch.h>
     12#include <pablo/pe_advance.h>
     13#include <pablo/pe_lookahead.h>
     14#include <pablo/pe_matchstar.h>
     15#include <pablo/pe_scanthru.h>
     16#include <pablo/pe_infile.h>
     17#include <pablo/pe_count.h>
     18#include <pablo/pe_integer.h>
     19#include <pablo/pe_string.h>
     20#include <pablo/pe_zeroes.h>
     21#include <pablo/pe_ones.h>
     22#include <pablo/pe_var.h>
     23#include <pablo/ps_assign.h>
     24#include <pablo/pablo_kernel.h>
    925
    1026#define CHECK_SAME_TYPE(A, B) \
     
    1329
    1430using StreamType = IDISA::StreamType;
     31using namespace llvm;
    1532
    1633inline void printType(const Type * type, raw_string_ostream & out) {
     
    3451/// UNARY CREATE FUNCTIONS
    3552///
    36 
    37 Call * PabloBlock::createCall(PabloAST * prototype, const std::vector<PabloAST *> &) {
    38     assert (prototype);
    39     return insertAtInsertionPoint(new (mAllocator) Call(prototype, mAllocator));
    40 }
    4153
    4254Count * PabloBlock::createCount(PabloAST * expr) {
     
    284296
    285297/** ------------------------------------------------------------------------------------------------------------- *
     298 * @brief Create
     299 ** ------------------------------------------------------------------------------------------------------------- */
     300PabloBlock * PabloBlock::Create(PabloKernel * const parent) noexcept {
     301    Allocator & allocator = parent->mAllocator;
     302    return new (allocator) PabloBlock(parent, allocator);
     303}
     304
     305/** ------------------------------------------------------------------------------------------------------------- *
    286306 * @brief insert
    287307 ** ------------------------------------------------------------------------------------------------------------- */
     
    315335
    316336/** ------------------------------------------------------------------------------------------------------------- *
     337 * @brief getPredecessor
     338 ** ------------------------------------------------------------------------------------------------------------- */
     339PabloBlock * PabloBlock::getPredecessor() const {
     340    return getBranch() ? getBranch()->getParent() : nullptr;
     341}
     342
     343/** ------------------------------------------------------------------------------------------------------------- *
    317344 * @brief print
    318345 ** ------------------------------------------------------------------------------------------------------------- */
  • icGREP/icgrep-devel/icgrep/pablo/codegenstate.h

    r5245 r5267  
    99
    1010#include <pablo/pabloAST.h>
    11 #include <pablo/symbol_generator.h>
    12 #include <pablo/boolean.h>
    13 #include <pablo/arithmetic.h>
    14 #include <pablo/branch.h>
    15 
    16 #include <pablo/pe_advance.h>
    17 #include <pablo/pe_lookahead.h>
    18 #include <pablo/pe_matchstar.h>
    19 #include <pablo/pe_scanthru.h>
    20 #include <pablo/pe_infile.h>
    21 
    22 #include <pablo/pe_count.h>
    23 
     11#include <pablo/pablo_kernel.h>
    2412#include <pablo/pe_integer.h>
    25 #include <pablo/pe_string.h>
    26 #include <pablo/pe_zeroes.h>
    27 #include <pablo/pe_ones.h>
    28 
    29 #include <pablo/pe_var.h>
    30 #include <pablo/ps_assign.h>
    31 
    32 #include <pablo/pe_call.h>
    33 
    34 #include <pablo/pablo_kernel.h>
    35 
    36 #include <llvm/ADT/ArrayRef.h>
    37 #include <stdexcept>
     13namespace llvm { class Type; }
     14namespace llvm { class raw_ostream; }
     15namespace pablo { class Add; }
     16namespace pablo { class Advance; }
     17namespace pablo { class And; }
     18namespace pablo { class Assign; }
     19namespace pablo { class AtEOF; }
     20namespace pablo { class Branch; }
     21namespace pablo { class If; }
     22namespace pablo { class While; }
     23namespace pablo { class Count; }
     24namespace pablo { class Extract; }
     25namespace pablo { class InFile; }
     26namespace pablo { class LessThan; }
     27namespace pablo { class Lookahead; }
     28namespace pablo { class MatchStar; }
     29namespace pablo { class Not; }
     30namespace pablo { class Ones; }
     31namespace pablo { class Or; }
     32namespace pablo { class PabloKernel; }
     33namespace pablo { class ScanThru; }
     34namespace pablo { class Sel; }
     35namespace pablo { class String; }
     36namespace pablo { class Subtract; }
     37namespace pablo { class Var; }
     38namespace pablo { class Xor; }
     39namespace pablo { class Zeroes; }
     40
    3841
    3942namespace pablo {
    40 
    41 class PabloKernel;
    4243
    4344class PabloBlock : public PabloAST, public StatementList {
     
    6162    }
    6263
    63     inline static PabloBlock * Create(PabloKernel * const parent) noexcept {
    64         Allocator & allocator = parent->mAllocator;
    65         return new (allocator) PabloBlock(parent, allocator);
    66     }
     64    static PabloBlock * Create(PabloKernel * const parent) noexcept;
    6765
    6866    Advance * createAdvance(PabloAST * expr, PabloAST * shiftAmount) {
     
    8684    Lookahead * createLookahead(PabloAST * expr, PabloAST * shiftAmount, String * name);
    8785
    88     inline Zeroes * createZeroes(Type * const type = nullptr) {
     86    inline Zeroes * createZeroes(llvm::Type * const type = nullptr) {
    8987        return mParent->getNullValue(type);
    9088    }
    9189
    92     inline Ones * createOnes(Type * const type = nullptr) {
     90    inline Ones * createOnes(llvm::Type * const type = nullptr) {
    9391        return mParent->getAllOnesValue(type);
    94     }
    95 
    96     inline Call * createCall(Prototype * prototype, const std::vector<Var *> & args) {
    97         return createCall(prototype, reinterpret_cast<const std::vector<PabloAST *> &>(args));
    98     }
    99 
    100     inline Call * createCall(Prototype * prototype, const std::vector<PabloAST *> & args) {
    101         if (prototype == nullptr) {
    102             throw std::runtime_error("Call object cannot be created with a Null prototype!");
    103         }
    104         if (args.size() != cast<Prototype>(prototype)->getNumOfParameters()) {
    105             throw std::runtime_error("Invalid number of arguments passed into Call object!");
    106         }
    107         return createCall(static_cast<PabloAST *>(prototype), args);
    10892    }
    10993
     
    118102    Not * createNot(PabloAST * expr, String * name);
    119103
    120     inline Var * createVar(const std::string & name, Type * const type = nullptr) {
     104    inline Var * createVar(const std::string & name, llvm::Type * const type = nullptr) {
    121105        return createVar(makeName(name), type);
    122106    }
    123107
    124     inline Var * createVar(String * name, Type * const type = nullptr) {
    125         return createVar(cast<PabloAST>(name), type);
     108    inline Var * createVar(String * name, llvm::Type * const type = nullptr) {
     109        return createVar(reinterpret_cast<PabloAST *>(name), type);
    126110    }
    127111
     
    150134    AtEOF * createAtEOF(PabloAST * expr, String * name);
    151135
     136    inline Extract * createExtract(PabloAST * array, PabloAST * index) {
     137        return createExtract(array, index, nullptr);
     138    }
     139
     140    Extract * createExtract(PabloAST * array, PabloAST * index, const std::string & prefix) {
     141        return createExtract(array, index, makeName(prefix));
     142    }
     143
    152144    Extract * createExtract(PabloAST * array, const int64_t index) {
    153145        return createExtract(array, getInteger(index), nullptr);
    154146    }
    155147
    156     inline Extract * createExtract(PabloAST * array, PabloAST * index) {
    157         return createExtract(array, index, nullptr);
    158     }
    159 
    160     Extract * createExtract(PabloAST * array, PabloAST * index, const std::string & prefix) {
    161         return createExtract(array, index, makeName(prefix));
    162     }
    163 
    164148    Extract * createExtract(PabloAST * array, const int64_t index, const std::string & prefix) {
    165149        return createExtract(array, getInteger(index), makeName(prefix));
     
    180164    And * createAnd(PabloAST * expr1, PabloAST * expr2, String * name);
    181165
    182     And * createAnd(Type * const type, const unsigned reserved) {
     166    And * createAnd(llvm::Type * const type, const unsigned reserved) {
    183167        return createAnd(type, reserved, nullptr);
    184168    }
    185169
    186     And * createAnd(Type * const type, const unsigned reserved, String * name);
     170    And * createAnd(llvm::Type * const type, const unsigned reserved, String * name);
    187171
    188172    Or * createOr(PabloAST * expr1, PabloAST * expr2) {
     
    196180    Or * createOr(PabloAST * expr1, PabloAST * expr2, String * name);
    197181
    198     Or * createOr(Type * const type, const unsigned reserved) {
     182    Or * createOr(llvm::Type * const type, const unsigned reserved) {
    199183        return createOr(type, reserved, nullptr);
    200184    }
    201185
    202     Or * createOr(Type * const type, const unsigned reserved, String * name);
     186    Or * createOr(llvm::Type * const type, const unsigned reserved, String * name);
    203187
    204188    Xor * createXor(PabloAST * expr1, PabloAST * expr2) {
     
    212196    Xor * createXor(PabloAST * expr1, PabloAST * expr2, String * name);
    213197
    214     Xor * createXor(Type * const type, const unsigned reserved) {
     198    Xor * createXor(llvm::Type * const type, const unsigned reserved) {
    215199        return createXor(type, reserved, nullptr);
    216200    }
    217201
    218     Xor * createXor(Type * const type, const unsigned reserved, String * name);
     202    Xor * createXor(llvm::Type * const type, const unsigned reserved, String * name);
    219203
    220204    Sel * createSel(PabloAST * condition, PabloAST * trueExpr, PabloAST * falseExpr) {
     
    258242    While * createWhile(PabloAST * condition, PabloBlock * body);
    259243
    260     Type * getStreamTy(const unsigned FieldWidth = 1) {
     244    llvm::Type * getStreamTy(const unsigned FieldWidth = 1) {
    261245        return mParent->getStreamTy(FieldWidth);
    262246    }
    263247   
    264     Type * getStreamSetTy(const unsigned NumElements = 1, const unsigned FieldWidth = 1) {
     248    llvm::Type * getStreamSetTy(const unsigned NumElements = 1, const unsigned FieldWidth = 1) {
    265249        return mParent->getStreamSetTy(NumElements, FieldWidth);
    266250    }
    267251   
    268     inline PabloBlock * getPredecessor() const {
    269         return getBranch() ? getBranch()->getParent() : nullptr;
    270     }
     252    PabloBlock * getPredecessor() const;
    271253
    272254    inline PabloKernel * getParent() const {
     
    306288    }
    307289
    308     void print(raw_ostream & O, const bool expandNested = true) const;
     290    void print(llvm::raw_ostream & O, const bool expandNested = true) const;
    309291
    310292    virtual ~PabloBlock() {}
     
    323305    template<typename Type>
    324306    inline Type * insertAtInsertionPoint(Type * expr) {
    325         if (isa<Statement>(expr)) {
    326             insert(cast<Statement>(expr));
     307        if (llvm::isa<Statement>(expr)) {
     308            insert(llvm::cast<Statement>(expr));
    327309        }
    328310        return expr;
    329311    }
    330312
    331     Call * createCall(PabloAST * prototype, const std::vector<PabloAST *> &);
    332 
    333     Var * createVar(PabloAST * name, Type * const type);
     313    Var * createVar(PabloAST * name, llvm::Type * const type);
    334314
    335315private:       
  • icGREP/icgrep-devel/icgrep/pablo/expression_map.hpp

    r5230 r5267  
    274274            case PabloAST::ClassTypeId::Or:
    275275            case PabloAST::ClassTypeId::Xor:
    276                 return mVariadic.findOrAdd(cast<Variadic>(stmt), stmt->getClassTypeId());
     276                return mVariadic.findOrAdd(llvm::cast<Variadic>(stmt), stmt->getClassTypeId());
    277277            case PabloAST::ClassTypeId::Advance:
    278278            case PabloAST::ClassTypeId::ScanThru:
    279279            case PabloAST::ClassTypeId::MatchStar:
    280280            case PabloAST::ClassTypeId::Assign:
     281            case PabloAST::ClassTypeId::Extract:
    281282                return mBinary.findOrAdd(stmt, stmt->getClassTypeId(), stmt->getOperand(0), stmt->getOperand(1));
    282283            case PabloAST::ClassTypeId::Sel:
    283284                return mTernary.findOrAdd(stmt, stmt->getClassTypeId(), stmt->getOperand(0), stmt->getOperand(1), stmt->getOperand(2));
    284             case PabloAST::ClassTypeId::Call:
    285                 // temporarily ignored
    286285            default:
    287286                return std::make_pair(stmt, true);
  • icGREP/icgrep-devel/icgrep/pablo/optimizers/codemotionpass.cpp

    r5217 r5267  
    22#include <pablo/pablo_kernel.h>
    33#include <pablo/codegenstate.h>
     4#include <pablo/branch.h>
     5#include <pablo/ps_assign.h>
     6#include <pablo/pe_var.h>
     7#ifndef NDEBUG
    48#include <pablo/analysis/pabloverifier.hpp>
     9#endif
    510#include <boost/container/flat_set.hpp>
    6 // #include <boost/circular_buffer.hpp>
    711
    812using namespace boost;
    913using namespace boost::container;
     14using namespace llvm;
    1015
    1116namespace pablo {
     
    8489            }
    8590        }
    86     } else if (!isa<Assign>(stmt)) {
    87         return findScopeUsages(stmt, scopeSet, block, nullptr);
     91        return true;
     92    } else if (isa<Assign>(stmt)) {
     93        return false;
    8894    }
    89     return false;
     95    return findScopeUsages(stmt, scopeSet, block, nullptr);
    9096}
    9197
  • icGREP/icgrep-devel/icgrep/pablo/optimizers/codemotionpass.h

    r5217 r5267  
    33
    44#include <vector>
    5 #include <algorithm>
    65
    76namespace pablo {
  • icGREP/icgrep-devel/icgrep/pablo/optimizers/distributivepass.cpp

    r5202 r5267  
    22
    33#include <pablo/codegenstate.h>
     4#ifndef NDEBUG
    45#include <pablo/analysis/pabloverifier.hpp>
     6#endif
    57#include <pablo/optimizers/pablo_simplifier.hpp>
    68#include <pablo/passes/flattenassociativedfg.h>
  • icGREP/icgrep-devel/icgrep/pablo/optimizers/pablo_automultiplexing.cpp

    r5230 r5267  
    88#include <boost/graph/topological_sort.hpp>
    99#include <boost/range/iterator_range.hpp>
     10#ifndef NDEBUG
    1011#include <pablo/analysis/pabloverifier.hpp>
     12#endif
    1113#include <pablo/optimizers/pablo_simplifier.hpp>
    1214#include <pablo/builder.hpp>
  • icGREP/icgrep-devel/icgrep/pablo/optimizers/pablo_bddminimization.cpp

    r5202 r5267  
    44#include <pablo/printer_pablos.h>
    55#include <pablo/optimizers/pablo_simplifier.hpp>
     6#ifndef NDEBUG
    67#include <pablo/analysis/pabloverifier.hpp>
     8#endif
    79#include <stack>
    810#include <bdd.h>
     
    5658            switch (stmt->getClassTypeId()) {
    5759                case TypeId::Advance:
    58                 case TypeId::Call:
    5960                case TypeId::MatchStar:
    6061                case TypeId::ScanThru:
  • icGREP/icgrep-devel/icgrep/pablo/optimizers/pablo_simplifier.cpp

    r5227 r5267  
    33#include <pablo/codegenstate.h>
    44#include <pablo/expression_map.hpp>
    5 //#include <pablo/function.h>
     5#include <pablo/boolean.h>
     6#include <pablo/pe_zeroes.h>
     7#include <pablo/pe_ones.h>
     8#include <pablo/arithmetic.h>
     9#include <pablo/branch.h>
     10#include <pablo/ps_assign.h>
     11#include <pablo/pe_advance.h>
     12#include <pablo/pe_scanthru.h>
     13#include <pablo/pe_matchstar.h>
     14#include <pablo/pe_var.h>
     15#ifndef NDEBUG
    616#include <pablo/analysis/pabloverifier.hpp>
    7 //#include <boost/container/flat_set.hpp>
    8 //#include <boost/container/flat_map.hpp>
    9 #include <pablo/printer_pablos.h>
    10 //#include <iostream>
     17#endif
    1118
    1219using namespace boost;
    1320using namespace boost::container;
     21using namespace llvm;
    1422
    1523namespace pablo {
  • icGREP/icgrep-devel/icgrep/pablo/optimizers/schedulingprepass.cpp

    r5202 r5267  
    44#include <boost/container/flat_set.hpp>
    55#include <boost/container/flat_map.hpp>
     6#ifndef NDEBUG
    67#include <pablo/analysis/pabloverifier.hpp>
     8#endif
    79#include <boost/graph/adjacency_list.hpp>
    810#include <unordered_map>
  • icGREP/icgrep-devel/icgrep/pablo/pabloAST.cpp

    r5230 r5267  
    55 */
    66
    7 #include <pablo/pabloAST.h>
    8 #include <pablo/codegenstate.h>
    9 #include <llvm/Support/Compiler.h>
    10 #include <pablo/printer_pablos.h>
    11 #include <llvm/ADT/SmallVector.h>
    12 #include <boost/container/flat_set.hpp>
    13 #include <pablo/printer_pablos.h>
     7#include "pabloAST.h"
     8#include <pablo/codegenstate.h>          // for PabloBlock
     9#include <pablo/pe_var.h>
     10#include <pablo/boolean.h>
     11#include <pablo/pe_infile.h>
     12#include <pablo/pe_zeroes.h>
     13#include <pablo/pe_ones.h>
     14#include <pablo/ps_assign.h>
     15#include <pablo/branch.h>
     16#include <pablo/printer_pablos.h>        // for PabloPrinter
    1417
    1518using namespace boost::container;
     19using namespace llvm;
    1620
    1721namespace pablo {
  • icGREP/icgrep-devel/icgrep/pablo/pabloAST.h

    r5240 r5267  
    88#define PE_PabloAST_H
    99
    10 #include <IR_Gen/types/streamtype.h>
    1110#include <llvm/Support/Casting.h>
    1211#include <llvm/Support/Compiler.h>
     
    1514#include <type_traits>
    1615#include <vector>
    17 
    18 using namespace llvm;
     16namespace llvm { class Type; }
     17namespace llvm { class raw_ostream; }
     18namespace pablo { class PabloBlock; }
     19namespace pablo { class String; }
    1920
    2021namespace pablo {
    21 
    22 class PabloBlock;
    23 class Statement;
    24 class String;
    25 class Branch;
    2622
    2723class PabloAST {
     
    3127    friend class Branch;
    3228    friend class PabloBlock;
    33     friend class Prototype;
    3429    friend class SymbolGenerator;
    3530    friend class Count;
     
    6156        , String
    6257        , Block
    63         , Function
    64         , Prototype
    6558        // Arithmetic expressions
    6659        , Add
     
    9285        , Assign
    9386        , Extract     
    94         , Call
    95         , SetIthBit
    9687        // Scope blocks
    9788        , If
     
    10798    }
    10899
    109     inline void setType(Type * type) noexcept {
     100    inline void setType(llvm::Type * type) noexcept {
    110101        mType = type;
    111102    }
     
    157148//    }
    158149
    159     void print(raw_ostream & O) const;
     150    void print(llvm::raw_ostream & O) const;
    160151
    161152protected:
    162     inline PabloAST(const ClassTypeId id, Type * const type, const String * name, Allocator & allocator)
     153    inline PabloAST(const ClassTypeId id, llvm::Type * const type, const String * name, Allocator & allocator)
    163154    : mClassTypeId(id)
    164155    , mType(type)
     
    174165private:
    175166    const ClassTypeId       mClassTypeId;
    176     Type *                  mType;
     167    llvm::Type *            mType;
    177168    const String *          mName;
    178169    Users                   mUsers;
     
    236227    virtual ~Statement() {}
    237228protected:
    238     explicit Statement(const ClassTypeId id, Type * const type, std::initializer_list<PabloAST *> operands, const String * const name, Allocator & allocator)
     229    explicit Statement(const ClassTypeId id, llvm::Type * const type, std::initializer_list<PabloAST *> operands, const String * const name, Allocator & allocator)
    239230    : PabloAST(id, type, name, allocator)
    240231    , mNext(nullptr)
     
    251242        }
    252243    }
    253     explicit Statement(const ClassTypeId id, Type * const type, const unsigned reserved, const String * const name, Allocator & allocator)
     244    explicit Statement(const ClassTypeId id, llvm::Type * const type, const unsigned reserved, const String * const name, Allocator & allocator)
    254245    : PabloAST(id, type, name, allocator)
    255246    , mNext(nullptr)
     
    261252    }
    262253    template<typename iterator>
    263     explicit Statement(const ClassTypeId id, Type * const type, iterator begin, iterator end, const String * const name, Allocator & allocator)
     254    explicit Statement(const ClassTypeId id, llvm::Type * const type, iterator begin, iterator end, const String * const name, Allocator & allocator)
    264255    : PabloAST(id, type, name, allocator)
    265256    , mNext(nullptr)
     
    345336
    346337protected:
    347     explicit Variadic(const ClassTypeId id, Type * const type, std::initializer_list<PabloAST *> operands, const String * const name, Allocator & allocator)
     338    explicit Variadic(const ClassTypeId id, llvm::Type * const type, std::initializer_list<PabloAST *> operands, const String * const name, Allocator & allocator)
    348339    : Statement(id, type, operands, name, allocator)
    349340    , mCapacity(operands.size())
     
    351342
    352343    }
    353     explicit Variadic(const ClassTypeId id, Type * const type, const unsigned reserved, const String * name, Allocator & allocator)
     344    explicit Variadic(const ClassTypeId id, llvm::Type * const type, const unsigned reserved, const String * name, Allocator & allocator)
    354345    : Statement(id, type, reserved, name, allocator)
    355346    , mCapacity(reserved)
     
    358349    }
    359350    template<typename iterator>
    360     explicit Variadic(const ClassTypeId id, Type * const type, iterator begin, iterator end, const String * name, Allocator & allocator)
     351    explicit Variadic(const ClassTypeId id, llvm::Type * const type, iterator begin, iterator end, const String * name, Allocator & allocator)
    361352    : Statement(id, type, begin, end, name, allocator)
    362353    , mCapacity(std::distance(begin, end))
  • icGREP/icgrep-devel/icgrep/pablo/pablo_compiler.cpp

    r5260 r5267  
    55 */
    66
    7 #include <pablo/pablo_compiler.h>
     7#include "pablo_compiler.h"
    88#include <pablo/pablo_kernel.h>
    99#include <pablo/pablo_toolchain.h>
    1010#include <pablo/codegenstate.h>
     11#include <pablo/boolean.h>
     12#include <pablo/arithmetic.h>
     13#include <pablo/branch.h>
     14#include <pablo/pe_advance.h>
     15#include <pablo/pe_lookahead.h>
     16#include <pablo/pe_matchstar.h>
     17#include <pablo/pe_scanthru.h>
     18#include <pablo/pe_infile.h>
     19#include <pablo/pe_count.h>
     20#include <pablo/pe_integer.h>
     21#include <pablo/pe_string.h>
     22#include <pablo/pe_zeroes.h>
     23#include <pablo/pe_ones.h>
     24#include <pablo/pe_var.h>
     25#include <pablo/ps_assign.h>
    1126#include <pablo/carry_manager.h>
    12 #include <pablo/printer_pablos.h>
    13 #include <pablo/prototype.h>
    14 #include <stdexcept>
    15 #include <sstream>
    1627#include <IR_Gen/idisa_builder.h>
    1728#include <llvm/IR/Module.h>
    18 #include <llvm/IR/IRBuilder.h>
    19 #include <iostream>
    20 #include <hrtime.h>
    21 #include <llvm/Support/Debug.h>
     29
     30using namespace llvm;
    2231
    2332namespace pablo {
     
    142151            std::string tmp;
    143152            raw_string_ostream out(tmp);
    144             PabloPrinter::print(var, out);
     153            var->print(out);
    145154            out << " is uninitialized prior to entering ";
    146             PabloPrinter::print(ifStatement, out);
     155            ifStatement->print(out);
    147156            llvm::report_fatal_error(out.str());
    148157        }
     
    186195            std::string tmp;
    187196            raw_string_ostream out(tmp);
    188             PabloPrinter::print(var, out);
     197            var->print(out);
    189198            out << " was not assigned a value.";
    190199            llvm::report_fatal_error(out.str());
     
    246255            std::string tmp;
    247256            raw_string_ostream out(tmp);
    248             PabloPrinter::print(var, out);
     257            var->print(out);
    249258            out << " is uninitialized prior to entering ";
    250             PabloPrinter::print(whileStatement, out);
     259            whileStatement->print(out);
    251260            llvm::report_fatal_error(out.str());
    252261        }
     
    298307            std::string tmp;
    299308            raw_string_ostream out(tmp);
    300             PabloPrinter::print(var, out);
     309            var->print(out);
    301310            out << " was not assigned a value.";
    302311            llvm::report_fatal_error(out.str());
     
    474483        } else {
    475484            std::string tmp;
    476             llvm::raw_string_ostream msg(tmp);
    477             msg << "Internal error: ";
    478             PabloPrinter::print(stmt, msg);
    479             msg << " is not a recognized statement in the Pablo compiler.";
    480             throw std::runtime_error(msg.str());
     485            llvm::raw_string_ostream out(tmp);
     486            out << "Internal error: ";
     487            stmt->print(out);
     488            out << " is not a recognized statement in the Pablo compiler.";
     489            throw std::runtime_error(out.str());
    481490        }
    482491
     
    535544        std::string tmp;
    536545        llvm::raw_string_ostream out(tmp);
    537         PabloPrinter::print(expr, out);
     546        expr->print(out);
    538547        out << " was used before definition!";
    539548        throw std::runtime_error(out.str());
  • icGREP/icgrep-devel/icgrep/pablo/pablo_compiler.h

    r5260 r5267  
    99
    1010#include <unordered_map>
    11 #include <llvm/IR/IRBuilder.h>
    12 #include <IR_Gen/idisa_builder.h>
    13 #include <kernels/kernel.h>
    1411#include <boost/container/flat_set.hpp>
    15 
    16 namespace llvm {
    17 class Value;
    18 class Function;
    19 }
     12namespace IDISA { class IDISA_Builder; }
     13namespace llvm { class Function; }
     14namespace llvm { class Value; }
     15namespace pablo { class CarryManager; }
     16namespace pablo { class If; }
     17namespace pablo { class PabloAST; }
     18namespace pablo { class PabloBlock; }
     19namespace pablo { class PabloKernel; }
     20namespace pablo { class Statement; }
     21namespace pablo { class While; }
    2022
    2123namespace pablo {
    22 
    23 class PabloAST;
    24 class PabloBlock;
    25 class PabloKernel;
    26 class String;
    27 class Statement;
    28 class If;
    29 class While;
    30 class CarryManager;
    3124
    3225class PabloCompiler {
     
    4538
    4639    void Examine();
     40
    4741    void Examine(const PabloBlock * const block);
    4842
    4943    void compileBlock(const PabloBlock * const block);
     44
    5045    void compileStatement(const Statement * stmt);
     46
    5147    void compileIf(const If * ifStmt);
     48
    5249    void compileWhile(const While * whileStmt);
    5350
  • icGREP/icgrep-devel/icgrep/pablo/pablo_kernel.cpp

    r5261 r5267  
    88#include <pablo/pablo_compiler.h>
    99#include <pablo/pe_var.h>
     10#include <pablo/pe_zeroes.h>
     11#include <pablo/pe_ones.h>
    1012#include <llvm/IR/Module.h>
    1113#include <llvm/IR/Verifier.h>
     
    1618using namespace parabix;
    1719using namespace IDISA;
     20using namespace llvm;
    1821
    1922Var * PabloKernel::addInput(const std::string & name, Type * const type) {
     
    2932}
    3033
    31 Var * PabloKernel::addOutput(const std::string name, Type * const type) {
     34Var * PabloKernel::addOutput(const std::string & name, Type * const type) {
    3235    Var * result = new (mAllocator) Var(mSymbolTable->make(name, iBuilder), type, mAllocator, false);
    3336    mOutputs.push_back(result);
     
    119122}
    120123
    121 PabloKernel::PabloKernel(IDISA::IDISA_Builder * builder, const std::string & kernelName)
    122 : KernelBuilder(builder, kernelName, {}, {}, {}, {}, {Binding{builder->getBitBlockType(), "EOFbit"}, Binding{builder->getBitBlockType(), "EOFmask"}})
     124PabloKernel::PabloKernel(IDISA::IDISA_Builder * builder, std::string kernelName)
     125: KernelBuilder(builder, std::move(kernelName), {}, {}, {}, {}, {Binding{builder->getBitBlockType(), "EOFbit"}, Binding{builder->getBitBlockType(), "EOFmask"}})
    123126, mPabloCompiler(new PabloCompiler(this))
    124127, mSymbolTable(new SymbolGenerator(mAllocator))
  • icGREP/icgrep-devel/icgrep/pablo/pablo_kernel.h

    r5250 r5267  
    1010#include <pablo/symbol_generator.h>
    1111#include <util/slab_allocator.h>
    12 
    13 namespace IDISA {
    14 class IDISA_Builder;
    15 }
     12namespace IDISA { class IDISA_Builder; }
     13namespace llvm { class Type; }
     14namespace pablo { class Integer; }
     15namespace pablo { class Ones; }
     16namespace pablo { class PabloAST; }
     17namespace pablo { class PabloBlock; }
     18namespace pablo { class PabloCompiler; }
     19namespace pablo { class String; }
     20namespace pablo { class Var; }
     21namespace pablo { class Zeroes; }
    1622
    1723namespace pablo {
    18    
    19 class PabloCompiler;
    20 class PabloBlock;
    21 class PabloAST;
    22 class CarryManager;
    23 class Var;
    24 class Zeroes;
    25 class Ones;
    26 class String;
    27 class Integer;
    2824
    2925class PabloKernel : public kernel::KernelBuilder {
     
    3733    using Allocator = SlabAllocator<PabloAST *>;
    3834
    39     PabloKernel(IDISA::IDISA_Builder * builder, const std::string & kernelName);
     35    PabloKernel(IDISA::IDISA_Builder * builder, std::string kernelName);
    4036    // At present only population count accumulator are supported,
    4137    // using the pablo.Count operation.
     
    6561    }
    6662
    67     Var * addInput(const std::string & name, Type * const type);
     63    Var * addInput(const std::string & name, llvm::Type * const type);
    6864
    6965    unsigned getNumOfInputs() const {
     
    7975    }
    8076
    81     Var * addOutput(const std::string name, Type * const type);
     77    Var * addOutput(const std::string & name, llvm::Type * const type);
    8278
    8379    unsigned getNumOfOutputs() const {
     
    8581    }
    8682
    87     Var * makeVariable(PabloAST * name, Type * const type);
     83    Var * makeVariable(PabloAST * name, llvm::Type * const type);
    8884
    8985    Var * getVariable(const unsigned index) {
     
    9591    }
    9692
    97     Zeroes * getNullValue(Type * const type);
     93    Zeroes * getNullValue(llvm::Type * const type);
    9894
    99     Ones * getAllOnesValue(Type * const type);
     95    Ones * getAllOnesValue(llvm::Type * const type);
    10096
    10197    inline SymbolGenerator * getSymbolTable() const {
  • icGREP/icgrep-devel/icgrep/pablo/pablo_toolchain.cpp

    r5230 r5267  
    55 */
    66
    7 #include <pablo/pablo_toolchain.h>
     7#include "pablo_toolchain.h"
    88#include <pablo/pablo_kernel.h>
    9 #include <pablo/pablo_compiler.h>
    109#include <pablo/optimizers/pablo_simplifier.hpp>
    1110#include <pablo/optimizers/codemotionpass.h>
     
    2827#include <hrtime.h>
    2928#endif
    30 #include <string>
    31 #include <iostream>
    32 #include <fstream>
    33 #include <sstream>
     29
     30
     31using namespace llvm;
    3432
    3533namespace pablo {
    36 
    3734
    3835static cl::OptionCategory PabloOptions("Pablo Options", "These options control printing, generation and instrumentation of Pablo intermediate code.");
     
    8077    std::stack<const Statement *> scope;
    8178    unsigned statements = 0;
    82     // Scan through and collect all the advances, calls, scanthrus and matchstars ...
     79    // Scan through and collect all the advances, scanthrus and matchstars ...
    8380    for (const Statement * stmt = entry->getEntryBlock()->front(); ; ) {
    8481        while ( stmt ) {
     
    109106    unsigned advances = 0;
    110107
    111     // Scan through and collect all the advances, calls, scanthrus and matchstars ...
     108    // Scan through and collect all the advances, scanthrus and matchstars ...
    112109    for (const Statement * stmt = entry->getEntryBlock()->front(); ; ) {
    113110        while ( stmt ) {
     
    140137    std::stack<const Statement *> scope;
    141138    DistributionMap distribution;
    142     // Scan through and collect all the advances, calls, scanthrus and matchstars ...
     139    // Scan through and collect all the advances, scanthrus and matchstars ...
    143140    for (const Statement * stmt = entry->getEntryBlock()->front(); ; ) {
    144141        while ( stmt ) {
  • icGREP/icgrep-devel/icgrep/pablo/pablo_toolchain.h

    r5217 r5267  
    88#define PABLO_TOOLCHAIN_H
    99
    10 namespace llvm {
    11 namespace cl {
    12 class OptionCategory;
    13 }
    14 }
     10namespace llvm { namespace cl { class OptionCategory; } }
     11namespace pablo { class PabloKernel; }
    1512
    1613namespace pablo {
    17 
    18 class PabloKernel;
    1914
    2015enum PabloDebugFlags {
  • icGREP/icgrep-devel/icgrep/pablo/passes/flattenif.cpp

    r5217 r5267  
    1 #include <pablo/passes/flattenif.hpp>
    2 #include <pablo/pablo_kernel.h>
     1#include "flattenif.hpp"
    32#include <pablo/codegenstate.h>
     3#include <pablo/branch.h>
     4#ifndef NDEBUG
    45#include <pablo/analysis/pabloverifier.hpp>
     6#endif
     7
     8using namespace llvm;
    59
    610namespace pablo {
  • icGREP/icgrep-devel/icgrep/pablo/pe_advance.h

    r5230 r5267  
    99
    1010#include <pablo/pabloAST.h>
    11 #include <pablo/symbol_generator.h>
    1211#include <pablo/pe_integer.h>
    1312
     
    2928    }
    3029    inline int64_t getAmount() const {
    31         return cast<Integer>(getOperand(1))->value();
     30        return llvm::cast<Integer>(getOperand(1))->value();
    3231    }
    3332protected:
    3433    Advance(PabloAST * expr, PabloAST * shiftAmount, const String * name, Allocator & allocator)
    3534    : Statement(ClassTypeId::Advance, expr->getType(), {expr, shiftAmount}, name, allocator) {
    36         assert(isa<Integer>(shiftAmount));
     35        assert(llvm::isa<Integer>(shiftAmount));
    3736    }
    3837};
  • icGREP/icgrep-devel/icgrep/pablo/pe_count.h

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

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

    r5230 r5267  
    99
    1010#include <pablo/pabloAST.h>
    11 #include <pablo/symbol_generator.h>
    1211#include <pablo/pe_integer.h>
    1312
     
    2928    }
    3029    inline int64_t getAmount() const {
    31         return cast<Integer>(getOperand(1))->value();
     30        return llvm::cast<Integer>(getOperand(1))->value();
    3231    }
    3332protected:
    3433    Lookahead(PabloAST * expr, PabloAST * shiftAmount, const String * name, Allocator & allocator)
    3534    : Statement(ClassTypeId::Lookahead, expr->getType(), {expr, shiftAmount}, name, allocator) {
    36         assert(isa<Integer>(shiftAmount));
     35        assert(llvm::isa<Integer>(shiftAmount));
    3736    }
    3837};
  • icGREP/icgrep-devel/icgrep/pablo/pe_ones.h

    r5230 r5267  
    2828    }
    2929    virtual bool operator==(const PabloAST & other) const {
    30         return isa<Ones>(other);
     30        return llvm::isa<Ones>(other);
    3131    }
    3232protected:
    33     Ones(Type * const type, Allocator & allocator)
     33    Ones(llvm::Type * const type, Allocator & allocator)
    3434    : PabloAST(ClassTypeId::Ones, type, nullptr, allocator) {
    3535    }
  • icGREP/icgrep-devel/icgrep/pablo/pe_string.h

    r5230 r5267  
    44#include <pablo/pabloAST.h>
    55#include <llvm/ADT/StringRef.h>
    6 #include <llvm/ADT/Twine.h>
    7 #include <llvm/ADT/SmallVector.h>
    8 #include <string>
    9 #include <ostream>
    106#include <llvm/Support/raw_os_ostream.h>
    117
     
    1410class String : public PabloAST {
    1511    friend class SymbolGenerator;
    16     friend class Prototype;
    1712    friend std::ostream & operator<< (std::ostream& stream, const String & string);
    1813public:
    1914    using StringAllocator = SlabAllocator<char>;
    20     using Value = StringRef;
    2115
    2216    static inline bool classof(const PabloAST * e) {
     
    2923
    3024    }
    31     inline const StringRef & value() const {
     25    inline const llvm::StringRef & value() const {
    3226        return mValue;
    3327    }
     
    3529        return mValue.str();
    3630    }
    37     inline StringRef value() {
     31    inline llvm::StringRef value() {
    3832        return mValue;
    3933    }
    4034protected:
    41     String(Type * type, const std::string & value, Allocator & allocator) noexcept
     35    String(llvm::Type * type, const std::string & value, Allocator & allocator) noexcept
    4236    : PabloAST(ClassTypeId::String, type, this, allocator)
    4337    , mValue(duplicate(value, allocator)) {
     
    5246    }
    5347private:
    54     const StringRef        mValue;
     48    const llvm::StringRef mValue;
    5549};
    5650
  • icGREP/icgrep-devel/icgrep/pablo/pe_var.h

    r5230 r5267  
    1010#include <pablo/pabloAST.h>
    1111#include <pablo/pe_string.h>
    12 #include <pablo/pe_integer.h>
    1312
    1413namespace pablo {
    15 
    16 class Assign;
    1714
    1815class Var : public PabloAST {
     
    3532    }
    3633protected:
    37     Var(const PabloAST * name, Type * const type, Allocator & allocator, const bool readOnly = false)
    38     : PabloAST(ClassTypeId::Var, type, cast<String>(name), allocator)
     34    Var(const PabloAST * name, llvm::Type * const type, Allocator & allocator, const bool readOnly = false)
     35    : PabloAST(ClassTypeId::Var, type, llvm::cast<String>(name), allocator)
    3936    , mReadOnly(readOnly) {
    4037
     
    6259    }
    6360protected:
    64     Extract(PabloAST * array, PabloAST * const index, const String * const name, Type * type, Allocator & allocator)
     61    Extract(PabloAST * array, PabloAST * const index, const String * const name, llvm::Type * type, Allocator & allocator)
    6562    : Statement(ClassTypeId::Extract, type, {array, index}, name, allocator) {
    6663
  • icGREP/icgrep-devel/icgrep/pablo/pe_zeroes.h

    r5230 r5267  
    99
    1010#include <pablo/pabloAST.h>
    11 #include <pablo/pe_var.h>
    1211
    1312namespace pablo {
     
    3029    }
    3130    virtual bool operator==(const PabloAST & other) const {
    32         return isa<Zeroes>(other);
     31        return llvm::isa<Zeroes>(other);
    3332    }
    3433protected:
    35     Zeroes(Type * const type, Allocator & allocator)
     34    Zeroes(llvm::Type * const type, Allocator & allocator)
    3635    : PabloAST(ClassTypeId::Zeroes, type, nullptr, allocator) {
    3736    }
  • icGREP/icgrep-devel/icgrep/pablo/printer_pablos.cpp

    r5227 r5267  
    77#include "printer_pablos.h"
    88#include <pablo/codegenstate.h>
     9#include <pablo/boolean.h>
     10#include <pablo/arithmetic.h>
     11#include <pablo/branch.h>
     12#include <pablo/pe_advance.h>
     13#include <pablo/pe_lookahead.h>
     14#include <pablo/pe_matchstar.h>
     15#include <pablo/pe_scanthru.h>
     16#include <pablo/pe_infile.h>
     17#include <pablo/pe_count.h>
     18#include <pablo/pe_integer.h>
     19#include <pablo/pe_string.h>
     20#include <pablo/pe_zeroes.h>
     21#include <pablo/pe_ones.h>
     22#include <pablo/pe_var.h>
     23#include <pablo/ps_assign.h>
    924#include <pablo/pablo_kernel.h>
    1025#include <llvm/Support/raw_os_ostream.h>
    1126
    1227using namespace pablo;
    13 
     28using namespace llvm;
    1429using TypeId = PabloAST::ClassTypeId;
    1530
    1631const unsigned BlockIndenting = 2;
    1732
    18 void PabloPrinter::print(const PabloKernel * kernel, llvm::raw_ostream & out) {
     33void PabloPrinter::print(const PabloKernel * kernel, raw_ostream & out) {
    1934    print(kernel->getEntryBlock(), out, true);
    2035}
    2136
    22 void PabloPrinter::print(const Statement * stmt, llvm::raw_ostream & out, const bool expandNested, const unsigned indent) {
     37void PabloPrinter::print(const Statement * stmt, raw_ostream & out, const bool expandNested, const unsigned indent) {
    2338    out.indent(indent);
    2439    if (stmt == nullptr) {
     
    176191    } else if (isa<Integer>(expr)) {
    177192        out << cast<Integer>(expr)->value();
    178     } else if (isa<Prototype>(expr)) {
    179         out << cast<Prototype>(expr)->getName();
    180193    } else {
    181194        out << "???";
     
    183196}
    184197
    185 void PabloPrinter::print(const PabloBlock * block, llvm::raw_ostream & strm, const bool expandNested, const unsigned indent) {
     198void PabloPrinter::print(const PabloBlock * block, raw_ostream & strm, const bool expandNested, const unsigned indent) {
    186199    for (const Statement * stmt : *block) {
    187200        print(stmt, strm, expandNested, indent);
  • icGREP/icgrep-devel/icgrep/pablo/symbol_generator.h

    r5230 r5267  
    1212#include <string>
    1313
    14 namespace IDISA {
    15     class IDISA_Builder;
    16 }
     14namespace IDISA { class IDISA_Builder; }
     15namespace pablo { class String; }
     16namespace pablo { class Integer; }
    1717
    1818namespace pablo {
    1919
    20 class String;
    21 class Integer;
    22 
    2320class SymbolGenerator {
    2421    friend class PabloBlock;
    25     using Twine = llvm::Twine;
    2622    using Allocator = PabloAST::Allocator;
    2723public:
  • icGREP/icgrep-devel/icgrep/re/printer_re.cpp

    r5091 r5267  
    2222
    2323using namespace re;
     24using namespace llvm;
    2425
    25 const std::string Printer_RE::PrintRE(const RE * re)
    26 {
     26const std::string Printer_RE::PrintRE(const RE * re) {
    2727    std::string retVal = "";
    2828
    2929    if (re == nullptr) {
    3030        retVal = "<NULL>";
    31     }
    32     else if (const Alt* re_alt = dyn_cast<const Alt>(re))
    33     {
     31    } else if (const Alt* re_alt = dyn_cast<const Alt>(re)) {
    3432        retVal += "(Alt[";
    3533        bool comma = false;
     
    4240        }
    4341        retVal += "])";
    44     }
    45     else if (const CC* re_cc = dyn_cast<const CC>(re))
    46     {
     42    } else if (const CC* re_cc = dyn_cast<const CC>(re)) {
    4743        retVal = "CC \"";
    4844        retVal += re_cc->canonicalName(UnicodeClass);
     
    5551            retVal += "]";
    5652        }
    57     }
    58     else if (const Name* re_name = dyn_cast<const Name>(re))
    59     {
     53    } else if (const Name* re_name = dyn_cast<const Name>(re)) {
    6054        retVal = "Name \"";
    6155        retVal += re_name->getName();
    6256        retVal += "\" ";
    63     }
    64     else if (const Assertion * a = dyn_cast<const Assertion>(re)) {
     57    } else if (const Assertion * a = dyn_cast<const Assertion>(re)) {
    6558        retVal = (a->getSense() == Assertion::Sense::Positive) ? "" : "Negative";
    6659        retVal += (a->getKind() == Assertion::Kind::Lookahead) ? "Lookahead" : "Lookbehind";
     
    6861        retVal += PrintRE(a->getAsserted());
    6962        retVal += ") ";
    70     }
    71     else if (const Diff* diff = dyn_cast<const Diff>(re))
    72     {
     63    } else if (const Diff* diff = dyn_cast<const Diff>(re)) {
    7364        retVal = "Diff (";
    7465        retVal += PrintRE(diff->getLH());
     
    7667        retVal += PrintRE(diff->getRH());
    7768        retVal += ") ";
    78     }
    79     else if (const Intersect* x = dyn_cast<const Intersect>(re))
    80     {
     69    } else if (const Intersect* x = dyn_cast<const Intersect>(re)) {
    8170        retVal = "Intersect (";
    8271        retVal += PrintRE(x->getLH());
     
    8473        retVal += PrintRE(x->getRH());
    8574        retVal += ") ";
    86     }
    87     else if (isa<const End>(re))
    88     {
     75    } else if (isa<const End>(re)) {
    8976        retVal = "End";
    90     }
    91     else if (const Rep* re_rep = dyn_cast<const Rep>(re))
    92     {
     77    } else if (const Rep* re_rep = dyn_cast<const Rep>(re)) {
    9378        retVal = "Rep(";
    9479        retVal.append(PrintRE(re_rep->getRE()));
     
    10388        }
    10489        retVal.append(")");
    105     }
    106     else if (const Seq* re_seq = dyn_cast<const Seq>(re))
    107     {
     90    } else if (const Seq* re_seq = dyn_cast<const Seq>(re)) {
    10891        retVal = "(Seq[";
    10992        bool comma = false;
     
    11699        }
    117100        retVal.append("])");
    118     }
    119     else if (isa<const Start>(re))
    120     {
     101    } else if (isa<const Start>(re)) {
    121102        retVal = "Start";
    122     }
    123     else if (isa<const Any>(re))
    124     {
     103    } else if (isa<const Any>(re)) {
    125104        retVal = "Any";
    126     }
    127     else
    128     {
     105    } else {
    129106        retVal = "???";
    130107    }
  • icGREP/icgrep-devel/icgrep/re/re_alt.h

    r4852 r5267  
    99
    1010#include "re_re.h"
    11 #include "re_cc.h"
     11#include <llvm/Support/Casting.h>
    1212
    1313namespace re {
     
    3636    void flatten(iterator begin, iterator end) {
    3737        for (auto i = begin; i != end; ++i) {
    38             if (LLVM_UNLIKELY(isa<Alt>(*i))) {
    39                 flatten<Alt::iterator>(cast<Alt>(*i)->begin(), cast<Alt>(*i)->end());
     38            if (LLVM_UNLIKELY(llvm::isa<Alt>(*i))) {
     39                flatten<Alt::iterator>(llvm::cast<Alt>(*i)->begin(), llvm::cast<Alt>(*i)->end());
    4040            } else {
    4141                push_back(*i);
  • icGREP/icgrep-devel/icgrep/re/re_analysis.cpp

    r5233 r5267  
    1414#include <re/printer_re.h>
    1515#include <limits.h>
     16
     17using namespace llvm;
    1618
    1719namespace re {
     
    3638        if (n->getType() == Name::Type::Byte) {
    3739            return true;
    38         }
    39         else if (n->getType() == Name::Type::Capture || n->getType() == Name::Type::Reference) {
     40        } else if (n->getType() == Name::Type::Capture || n->getType() == Name::Type::Reference) {
    4041            return isByteLength(n->getDefinition());
    4142        }
     
    6970        if (n->getType() == Name::Type::Unicode || n->getType() == Name::Type::UnicodeProperty || n->getType() == Name::Type::Byte) {
    7071            return true;
    71         }
    72         else if (n->getType() == Name::Type::Capture || n->getType() == Name::Type::Reference) {
     72        } else if (n->getType() == Name::Type::Capture || n->getType() == Name::Type::Reference) {
    7373            return isUnicodeUnitLength(n->getDefinition());
    7474        }
     
    8080std::pair<int, int> getUnicodeUnitLengthRange(const RE * re) {
    8181    if (const Alt * alt = dyn_cast<Alt>(re)) {
    82         std::pair<int, int> range = std::make_pair(std::numeric_limits<int>::max(), 0);
     82        std::pair<int, int> range = std::make_pair(INT_MAX, 0);
    8383        for (const RE * re : *alt) {
    8484            auto r = getUnicodeUnitLengthRange(re);
     
    9191        for (const RE * re : *seq) {
    9292            auto tmp = getUnicodeUnitLengthRange(re);
    93             if (LLVM_LIKELY(tmp.first < std::numeric_limits<int>::max() - range.first)) {
     93            if (LLVM_LIKELY(tmp.first < (INT_MAX - range.first))) {
    9494                range.first += tmp.first;
    9595            } else {
    96                 range.first = std::numeric_limits<int>::max();
     96                range.first = INT_MAX;
    9797            }
    98             if (LLVM_LIKELY(tmp.second < std::numeric_limits<int>::max() - range.second)) {
     98            if (LLVM_LIKELY(tmp.second < (INT_MAX - range.second))) {
    9999                range.second += tmp.second;
    100100            } else {
    101                 range.second = std::numeric_limits<int>::max();
     101                range.second = INT_MAX;
    102102            }
    103103        }
     
    105105    } else if (const Rep * rep = dyn_cast<Rep>(re)) {
    106106        auto range = getUnicodeUnitLengthRange(rep->getRE());
    107         if (LLVM_LIKELY(rep->getLB() != Rep::UNBOUNDED_REP && range.first < std::numeric_limits<int>::max())) {
     107        if (LLVM_LIKELY(rep->getLB() != Rep::UNBOUNDED_REP && range.first < INT_MAX)) {
    108108            range.first *= rep->getLB();
    109109        } else {
    110             range.first = std::numeric_limits<int>::max();
     110            range.first = INT_MAX;
    111111        }
    112         if (LLVM_LIKELY(rep->getUB() != Rep::UNBOUNDED_REP && range.second < std::numeric_limits<int>::max())) {
     112        if (LLVM_LIKELY(rep->getUB() != Rep::UNBOUNDED_REP && range.second < INT_MAX)) {
    113113            range.second *= rep->getUB();
    114114        } else {
    115             range.second = std::numeric_limits<int>::max();
     115            range.second = INT_MAX;
    116116        }
    117117        return range;
     
    139139                return std::make_pair(0, 0);
    140140            case Name::Type::Unknown:
    141                 return std::make_pair(0, std::numeric_limits<int>::max());
     141                return std::make_pair(0, INT_MAX);
    142142        }
    143143    }
     
    152152        }
    153153        return minAltLength;
    154     }
    155     else if (Seq * seq = dyn_cast<Seq>(re)) {
     154    } else if (Seq * seq = dyn_cast<Seq>(re)) {
    156155        int minSeqLength = 0;
    157156        for (RE * re : *seq) {
     
    159158        }
    160159        return minSeqLength;
    161     }
    162     else if (Rep * rep = dyn_cast<Rep>(re)) {
     160    } else if (Rep * rep = dyn_cast<Rep>(re)) {
    163161        if (rep->getLB() == 0) return 0;
    164162        else return (rep->getLB()) * minMatchLength(rep->getRE());
    165     }
    166     else if (isa<Assertion>(re)) {
     163    } else if (isa<Assertion>(re)) {
    167164        return 0;
    168     }
    169     else if (Diff * diff = dyn_cast<Diff>(re)) {
     165    } else if (Diff * diff = dyn_cast<Diff>(re)) {
    170166        return minMatchLength(diff->getLH());
    171     }
    172     else if (Intersect * e = dyn_cast<Intersect>(re)) {
     167    } else if (Intersect * e = dyn_cast<Intersect>(re)) {
    173168        return std::min(minMatchLength(e->getLH()), minMatchLength(e->getRH()));
    174     }
    175     else if (isa<Any>(re)) {
     169    } else if (isa<Any>(re)) {
    176170        return 1;
    177171    } else if (const Name * n = dyn_cast<Name>(re)) {
  • icGREP/icgrep-devel/icgrep/re/re_analysis.h

    r4829 r5267  
    22#define RE_ANALYSIS_H
    33
    4 //Regular Expressions
    5 #include "re_seq.h"
    6 #include <list>
     4#include <utility>
     5namespace re { class RE; }
    76
    87namespace re {
    98
    10 bool isByteLength(const RE *re);
     9bool isByteLength(const RE * re);
    1110   
    1211bool isUnicodeUnitLength(const RE * re);
  • icGREP/icgrep-devel/icgrep/re/re_any.h

    r4245 r5267  
    77#ifndef ANY_H
    88#define ANY_H
    9 
    10 #include "re_re.h"
    119
    1210#include "re_re.h"
  • icGREP/icgrep-devel/icgrep/re/re_cc.h

    r5037 r5267  
    99
    1010#include "re_re.h"
    11 
    12 #include <string>
    13 #include <vector>
    1411#include <UCD/unicode_set.h>
    15 #include <util/slab_allocator.h>
    1612
    1713namespace re {
     
    5551    friend CC * subtractCC(const CC * a, const CC * b);
    5652    friend CC * intersectCC(const CC * a, const CC * b);
    57     friend CC * caseInsensitize(const CC * a, const CC * b);
    5853
    5954    inline CC()
  • icGREP/icgrep-devel/icgrep/re/re_compiler.cpp

    r5234 r5267  
    44 *  icgrep is a trademark of International Characters.
    55 */
    6 #include <re/re_compiler.h>
    7 #include <re/re_toolchain.h>
    8 #include <re/re_name_resolve.h>
    9 //Regular Expressions
    10 #include <re/re_name.h>
     6
     7
     8
     9#include "re_compiler.h"
     10#include <pablo/pe_ones.h>          // for Ones
     11#include <pablo/pe_var.h>           // for Var
     12#include <pablo/pe_zeroes.h>        // for Zeroes
     13#include <re/printer_re.h>
     14#include <re/re_alt.h>
     15#include <re/re_analysis.h>         // for isByteLength, isUnicodeUnitLength
    1116#include <re/re_any.h>
     17#include <re/re_assertion.h>        // for Assertion, Assertion::Sense, Asse...
     18#include <re/re_cc.h>               // for makeCC
     19#include <re/re_diff.h>             // for Diff
     20#include <re/re_end.h>
     21#include <re/re_intersect.h>        // for Intersect
     22#include <re/re_name.h>             // for Name, Name::Type, Name::Type::Zer...
     23#include <re/re_name_resolve.h>     // for resolveNames
     24#include <re/re_rep.h>              // for Rep, Rep::::UNBOUNDED_REP
     25#include <re/re_seq.h>              // for Seq
    1226#include <re/re_start.h>
    13 #include <re/re_end.h>
    14 #include <re/re_alt.h>
    15 #include <re/re_cc.h>
    16 #include <re/re_seq.h>
    17 #include <re/re_rep.h>
    18 #include <re/re_diff.h>
    19 #include <re/re_intersect.h>
    20 #include <re/re_assertion.h>
    21 #include <re/re_analysis.h>
    22 #include <re/re_memoizer.hpp>
    23 #include <re/printer_re.h>
    24 #include <pablo/codegenstate.h>
    25 #include <pablo/pablo_kernel.h>
    26 #include <UCD/ucd_compiler.hpp>
    27 #include <UCD/resolve_properties.h>
    28 #include <assert.h>
    29 #include <stdexcept>
    30 #include <iostream>
    31 #include <pablo/printer_pablos.h>
    32 #include "llvm/Support/CommandLine.h"
    33 #include <sstream>
    34 #include <unordered_set>
     27#include <re/re_toolchain.h>        // for AlgorithmOptionIsSet, RE_Algorith...
     28#include "cc/cc_compiler.h"         // for CC_Compiler
     29#include "pablo/builder.hpp"        // for PabloBuilder
     30namespace pablo { class PabloAST; }
     31namespace pablo { class PabloKernel; }
     32namespace re { class Alt; }
     33namespace re { class RE; }
    3534
    3635
     
    3837
    3938using namespace pablo;
     39using namespace llvm;
    4040
    4141namespace re {
     
    5151
    5252void RE_Compiler::initializeRequiredStreams_utf16() {
    53 
    54 
    55 
    5653    PabloAST * LF = mCCCompiler.compileCC("LF", makeCC(0x000A), mPB);
    5754    PabloAST * CR = mCCCompiler.compileCC("CR", makeCC(0x000D), mPB);
  • icGREP/icgrep-devel/icgrep/re/re_compiler.h

    r5233 r5267  
    88#define RE_TO_PABLO_COMPILER_H
    99
    10 #include <re/re_re.h>
    11 #include <re/re_seq.h>
    12 #include <cc/cc_compiler.h>
    13 #include <pablo/builder.hpp>
     10#include <re/re_seq.h>  // for Seq
    1411#include <boost/container/flat_map.hpp>
     12#include <vector>       // for vector<>::iterator
     13namespace cc { class CC_Compiler; }
     14namespace pablo { class PabloAST; }
     15namespace pablo { class PabloBuilder; }
     16namespace pablo { class PabloKernel; }
     17namespace re { class Alt; }
     18namespace re { class Assertion; }
     19namespace re { class Diff; }
     20namespace re { class Intersect; }
     21namespace re { class Name; }
     22namespace re { class RE; }
     23namespace re { class Rep; }
    1524
    16 namespace UCD {
    17 class UnicodeSet;
    18 }
     25//namespace UCD {
     26//class UnicodeSet;
     27//}
    1928
    2029/*   Marker streams represent the results of matching steps.
  • icGREP/icgrep-devel/icgrep/re/re_diff.cpp

    r4321 r5267  
    88#include "re_cc.h"
    99#include <llvm/Support/Casting.h>
     10
     11using namespace llvm;
    1012
    1113namespace re {
  • icGREP/icgrep-devel/icgrep/re/re_diff.h

    r4516 r5267  
    33
    44#include <re/re_re.h>
    5 #include <re/re_cc.h>
    65
    76namespace re {
  • icGREP/icgrep-devel/icgrep/re/re_intersect.cpp

    r4321 r5267  
    88#include "re_cc.h"
    99#include <llvm/Support/Casting.h>
     10
     11using namespace llvm;
    1012
    1113namespace re {
  • icGREP/icgrep-devel/icgrep/re/re_memoizer.hpp

    r5037 r5267  
    99struct MemoizerComparator {
    1010    inline bool operator() (const RE * lh, const RE * rh) const{
    11         if (LLVM_LIKELY(isa<Name>(lh) && isa<Name>(rh))) {
    12             return *cast<Name>(lh) < *cast<Name>(rh);
    13         } else if (isa<Name>(lh)) {
    14             return *cast<Name>(lh) < *cast<CC>(rh);
     11        if (LLVM_LIKELY(llvm::isa<Name>(lh) && llvm::isa<Name>(rh))) {
     12            return *llvm::cast<Name>(lh) < *llvm::cast<Name>(rh);
     13        } else if (llvm::isa<Name>(lh)) {
     14            return *llvm::cast<Name>(lh) < *llvm::cast<CC>(rh);
    1515        }
    16         return *cast<Name>(rh) > *cast<CC>(lh);
     16        return *llvm::cast<Name>(rh) > *llvm::cast<CC>(lh);
    1717    }
    1818};
     
    2323        auto f = find(cc);
    2424        if (f != end()) {
    25             return cast<Name>(*f);
     25            return llvm::cast<Name>(*f);
    2626        } else {
    2727            Name * name = makeName(cc);
     
    3232
    3333    inline Name * memoize(Name * name) {
    34         return cast<Name>(*insert(name).first);
     34        return llvm::cast<Name>(*insert(name).first);
    3535    }
    3636};
  • icGREP/icgrep-devel/icgrep/re/re_name.h

    r5234 r5267  
    44#include <re/re_re.h>
    55#include <re/re_cc.h>
    6 #include <string>
     6#include <llvm/Support/Casting.h>
    77
    88namespace UCD {
     
    102102
    103103inline bool Name::operator < (const Name & other) const {
    104     if (LLVM_LIKELY(mDefinition && other.mDefinition && isa<CC>(mDefinition) && isa<CC>(other.mDefinition))) {
    105         return *cast<CC>(mDefinition) < *cast<CC>(other.mDefinition);
     104    if (LLVM_LIKELY(mDefinition && other.mDefinition && llvm::isa<CC>(mDefinition) && llvm::isa<CC>(other.mDefinition))) {
     105        return *llvm::cast<CC>(mDefinition) < *llvm::cast<CC>(other.mDefinition);
    106106    } else if (mNamespaceLength < other.mNamespaceLength) {
    107107        return true;
     
    123123
    124124inline bool Name::operator < (const CC & other) const {
    125     if (mDefinition && isa<CC>(mDefinition)) {
    126         return *cast<CC>(mDefinition) < other;
     125    if (mDefinition && llvm::isa<CC>(mDefinition)) {
     126        return *llvm::cast<CC>(mDefinition) < other;
    127127    }
    128128    return false;
     
    130130
    131131inline bool Name::operator > (const CC & other) const {
    132     if (mDefinition && isa<CC>(mDefinition)) {
    133         return other < *cast<CC>(mDefinition);
     132    if (mDefinition && llvm::isa<CC>(mDefinition)) {
     133        return other < *llvm::cast<CC>(mDefinition);
    134134    }
    135135    return true;
     
    145145
    146146inline Name * makeName(const std::string & name, RE * cc) {
    147     if (isa<Name>(cc)) {
    148         return cast<Name>(cc);
     147    if (llvm::isa<Name>(cc)) {
     148        return llvm::cast<Name>(cc);
    149149    }
    150     else if (isa<CC>(cc)) {
    151         Name::Type ccType = cast<CC>(cc)->max_codepoint() <= 0x7F ? Name::Type::Byte : Name::Type::Unicode;
     150    else if (llvm::isa<CC>(cc)) {
     151        Name::Type ccType = llvm::cast<CC>(cc)->max_codepoint() <= 0x7F ? Name::Type::Byte : Name::Type::Unicode;
    152152        return new Name(nullptr, 0, name.c_str(), name.length(), ccType, cc);
    153153    }
  • icGREP/icgrep-devel/icgrep/re/re_name_resolve.cpp

    r5241 r5267  
     1#include "re_name_resolve.h"
    12#include <re/re_name.h>
    2 #include <re/re_any.h>
    3 #include <re/re_start.h>
    4 #include <re/re_end.h>
    53#include <re/re_alt.h>
    64#include <re/re_cc.h>
     
    1715#include <sstream>
    1816
    19 #include <re/printer_re.h>
    20 #include <iostream>
    21 
    2217using NameMap = UCD::UCDCompiler::NameMap;
    2318
    2419using namespace boost::container;
     20using namespace llvm;
    2521
    2622namespace re {
  • icGREP/icgrep-devel/icgrep/re/re_nullable.cpp

    r5150 r5267  
    11#include "re_nullable.h"
    2 #include <re/re_cc.h>
    3 #include <re/re_start.h>
    4 #include <re/re_end.h>
    5 #include <re/re_alt.h>
    6 #include <re/re_rep.h>
    7 #include <re/re_any.h>
    8 #include <re/re_diff.h>
    9 #include <re/re_intersect.h>
    10 #include <re/re_assertion.h>
    11 #include <re/re_name.h>
     2#include <re/re_alt.h>             // for Alt, makeAlt
     3#include <re/re_any.h>             // for makeAny, Any
     4#include <re/re_assertion.h>       // for Assertion, Assertion::Sense, Asser...
     5#include <re/re_diff.h>            // for Diff, makeDiff
     6#include <re/re_intersect.h>       // for Intersect
     7#include <re/re_name.h>            // for Name
     8#include <re/re_rep.h>             // for Rep, makeRep
     9#include <re/re_seq.h>             // for Seq, makeSeq
     10#include <vector>                  // for vector, allocator
     11#include <llvm/Support/Casting.h>  // for dyn_cast, isa
    1212
    1313/*
     
    1818
    1919*/
     20
     21using namespace llvm;
    2022
    2123namespace re {
  • icGREP/icgrep-devel/icgrep/re/re_nullable.h

    r5147 r5267  
    22#define RE_NULLABLE_H
    33
    4 //Regular Expressions
    5 #include "re_re.h"
    6 #include "re_seq.h"
    7 #include <vector>
     4namespace re { class RE; }
     5namespace re { class Vector; }
    86
    97namespace re {
  • icGREP/icgrep-devel/icgrep/re/re_parser.cpp

    r5241 r5267  
    1313#include <re/re_name.h>
    1414#include <re/re_alt.h>
     15#include <re/re_any.h>
    1516#include <re/re_end.h>
    1617#include <re/re_rep.h>
     
    2829#include <algorithm>
    2930#include <iostream>
     31#include <llvm/Support/Casting.h>
     32#include <llvm/Support/ErrorHandling.h>
     33
     34using namespace llvm;
    3035
    3136namespace re {
    32    
     37
     38template<typename T, typename... Args>
     39std::unique_ptr<T> make_unique(Args&&... args) {
     40    return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
     41}
    3342
    3443RE * RE_Parser::parse(const std::string & regular_expression, ModeFlagSet initialFlags, RE_Syntax syntax) {
     
    3645    switch (syntax) {
    3746        case RE_Syntax::PCRE:
    38             parser = llvm::make_unique<RE_Parser_PCRE>(regular_expression);
     47            parser = make_unique<RE_Parser_PCRE>(regular_expression);
    3948            break;
    4049        case RE_Syntax::ERE:
    41             parser = llvm::make_unique<RE_Parser_ERE>(regular_expression);
     50            parser = make_unique<RE_Parser_ERE>(regular_expression);
    4251            break;
    4352        case RE_Syntax ::BRE:
    44             parser = llvm::make_unique<RE_Parser_BRE>(regular_expression);
     53            parser = make_unique<RE_Parser_BRE>(regular_expression);
    4554            break;
    4655        case RE_Syntax ::PROSITE:
    47             parser = llvm::make_unique<RE_Parser_PROSITE>(regular_expression);
     56            parser = make_unique<RE_Parser_PROSITE>(regular_expression);
    4857            break;
    4958        default:
     
    11281137}
    11291138
    1130 }
     1139LLVM_ATTRIBUTE_NORETURN void RE_Parser::ParseFailure(std::string errmsg) {
     1140    llvm::report_fatal_error(errmsg);
     1141}
     1142
     1143}
  • icGREP/icgrep-devel/icgrep/re/re_parser.h

    r5241 r5267  
    88#define RE_PARSER_H
    99
    10 #include <re/re_re.h>
    11 #include <re/re_any.h>
    12 #include <re/re_name.h>
    13 #include <UCD/resolve_properties.h>
    14 #include <string>
    15 #include <list>
    16 #include <memory>
    17 #include <map>
    18 #include <re/re_memoizer.hpp>
    19 #include <llvm/Support/ErrorHandling.h>
     10#include <map>                           // for map
     11#include <re/re_memoizer.hpp>            // for Memoizer
     12#include "re/re_cc.h"                    // for codepoint_t, CC (ptr only)
     13namespace re { class Name; }
    2014
    2115namespace re {
    2216
    2317enum RE_Syntax {FixedStrings, BRE, ERE, PCRE, PROSITE};
     18
    2419enum CharsetOperatorKind
    2520    {intersectOp, setDiffOp, ampChar, hyphenChar, rangeHyphen, posixPropertyOpener, setOpener, setCloser, backSlash, emptyOperator};
     
    3833const int MAX_REPETITION_UPPER_BOUND = 2048;
    3934
    40 typedef unsigned ModeFlagSet;
     35using ModeFlagSet = unsigned;
    4136
     37class RE_Parser {
     38public:
    4239
    43 class RE_Parser
    44 {
    45 public:
     40    static LLVM_ATTRIBUTE_NORETURN void ParseFailure(std::string errmsg);
    4641
    4742    static RE * parse(const std::string &input_string, ModeFlagSet initialFlags, RE_Syntax syntax = RE_Syntax::PCRE);
    4843
    49    
    50     static LLVM_ATTRIBUTE_NORETURN void ParseFailure(std::string errmsg) {
    51         llvm::report_fatal_error(errmsg);
    52     }
    53    
    5444protected:
     45
    5546    using NameMap = std::map<std::pair<std::string, std::string>, re::Name *>;
    5647
  • icGREP/icgrep-devel/icgrep/re/re_parser_bre.cpp

    r5206 r5267  
    88#include <re/re_parser_helper.h>
    99#include <re/re_alt.h>
     10#include <re/re_any.h>
    1011#include <re/re_seq.h>
    1112#include <re/re_start.h>
     
    1314#include <re/re_assertion.h>
    1415#include <re/re_rep.h>
     16
    1517
    1618namespace re{
  • icGREP/icgrep-devel/icgrep/re/re_parser_ere.h

    r5206 r5267  
    99
    1010#include <re/re_parser.h>
     11
    1112namespace re {
    1213    class RE_Parser_ERE : public RE_Parser  {
  • icGREP/icgrep-devel/icgrep/re/re_parser_pcre.h

    r5206 r5267  
    99
    1010#include <re/re_parser.h>
     11
    1112namespace re {
    1213    class RE_Parser_PCRE : public RE_Parser {
  • icGREP/icgrep-devel/icgrep/re/re_parser_prosite.cpp

    r5233 r5267  
    88#include <re/re_parser_helper.h>
    99#include <re/re_alt.h>
     10#include <re/re_any.h>
    1011#include <re/re_seq.h>
    1112#include <re/re_start.h>
  • icGREP/icgrep-devel/icgrep/re/re_re.h

    r5240 r5267  
    88#define RE_H
    99
     10#include <util/slab_allocator.h>
    1011#include <vector>
    11 #include <assert.h>
    12 #include <llvm/Support/Casting.h>
    13 #include <util/slab_allocator.h>
    14 
    15 using namespace llvm;
    1612
    1713namespace re {
    18 
    19 class Vector;
    20 class Pair;
    21 
    22 class Alt;
    23 class Any;
    24 class Assertion;
    25 class CC;
    26 class Diff;
    27 class End;
    28 class Intersect;
    29 class Name;
    30 class Permute;
    31 class Rep;
    32 class Seq;
    33 class Start;
    34 class SymDiff;
    35 class Union;
    3614
    3715class RE {
  • icGREP/icgrep-devel/icgrep/re/re_rep.cpp

    r4971 r5267  
    55 */
    66
     7#include "re_rep.h"
    78#include "re_assertion.h"
    8 #include "re_rep.h"
    99#include "re_seq.h"
     10#include <llvm/Support/Casting.h>
     11
     12using namespace llvm;
    1013
    1114namespace re {
  • icGREP/icgrep-devel/icgrep/re/re_seq.h

    r5197 r5267  
    99
    1010#include "re_re.h"
    11 #include <string>
    12 #include <initializer_list>
     11#include <llvm/Support/Casting.h>
    1312
    1413namespace re {
     
    4443void Seq::flatten(itr begin, itr end) {
    4544    for (auto i = begin; i != end; ++i) {
    46         if (LLVM_UNLIKELY(isa<Seq>(*i))) {
    47             flatten<Seq::iterator>(cast<Seq>(*i)->begin(), cast<Seq>(*i)->end());
     45        if (LLVM_UNLIKELY(llvm::isa<Seq>(*i))) {
     46            flatten<Seq::iterator>(llvm::cast<Seq>(*i)->begin(), llvm::cast<Seq>(*i)->end());
    4847        } else {
    4948            push_back(*i);
  • icGREP/icgrep-devel/icgrep/re/re_simplifier.cpp

    r5091 r5267  
    1515#include <memory>
    1616#include <queue>
     17
     18using namespace llvm;
    1719
    1820namespace re {
  • icGREP/icgrep-devel/icgrep/re/re_toolchain.cpp

    r5234 r5267  
    55 */
    66
    7 #include <string>
     7#include <re/re_toolchain.h>
     8#include <cc/cc_compiler.h>            // for CC_Compiler
     9#include <llvm/Support/CommandLine.h>  // for clEnumVal, clEnumValEnd, Optio...
     10#include <re/re_compiler.h>            // for RE_Compiler
     11#include <re/re_nullable.h>            // for RE_Nullable
     12#include <re/re_simplifier.h>          // for RE_Simplifier
     13#include <re/printer_re.h>
    814#include <iostream>
    9 #include <fstream>
    10 
    11 #include <re/re_toolchain.h>
    12 #include <re/re_cc.h>
    13 #include <re/re_nullable.h>
    14 #include <re/re_simplifier.h>
    15 #include <re/re_alt.h>
    16 #include <re/re_parser.h>
    17 #include <re/re_compiler.h>
    18 #include <utf8_encoder.h>
    19 #include <cc/cc_compiler.h>
    20 #include <pablo/pablo_kernel.h>
    21 #include <re/printer_re.h>
    22 #include <llvm/Support/CommandLine.h>
    23 
    2415
    2516using namespace pablo;
     17using namespace llvm;
     18
    2619namespace re {
    2720
  • icGREP/icgrep-devel/icgrep/re/re_toolchain.h

    r5217 r5267  
    88#define RE_TOOLCHAIN_H
    99
    10 #include <llvm/Support/CommandLine.h>
    11 
    12 namespace pablo {
    13     class PabloKernel;
    14 }
     10namespace llvm { namespace cl { class OptionCategory; } }
     11namespace pablo { class PabloKernel; }
     12namespace re { class RE; }
    1513
    1614namespace re {
    17 
    18 class RE;
    1915
    2016enum RE_PrintFlags {
  • icGREP/icgrep-devel/icgrep/re/re_utility.cpp

    r5197 r5267  
    55 */
    66
     7#include "re_utility.h"
    78#include <re/re_any.h>
    89#include <re/re_name.h>
    910#include <re/re_alt.h>
    1011#include <re/re_seq.h>
    11 #include <re/re_start.h>
    12 #include <re/re_end.h>
    1312#include <re/re_diff.h>
    1413#include <re/re_assertion.h>
  • icGREP/icgrep-devel/icgrep/re/re_utility.h

    r5197 r5267  
    88#define RE_UTILITY_H
    99
    10 #include <re/re_re.h>
    11 #include <re/re_name.h>
     10namespace re { class RE; }
     11namespace re { class Name; }
    1212
    1313namespace re {
  • icGREP/icgrep-devel/icgrep/toolchain.cpp

    r5238 r5267  
    55 */
    66
    7 #include <string>
    8 #include <iostream>
    9 #include <fstream>
    10 #include <sstream>
    11 
    12 #include <toolchain.h>
    13 #include <llvm/IR/Function.h>
    14 #include <llvm/IR/Module.h>
    15 #include <llvm/ExecutionEngine/ExecutionEngine.h>
    16 #include <llvm/ExecutionEngine/MCJIT.h>
    17 #include "llvm/IR/LegacyPassManager.h"
    18 
    19 #include <llvm/IRReader/IRReader.h>
    20 #include <llvm/Support/CommandLine.h>
    21 #include <llvm/CodeGen/CommandFlags.h>
    22 #include <llvm/Support/SourceMgr.h>
    23 #include <llvm/Support/TargetSelect.h>
    24 #include <llvm/Support/Host.h>
    25 #include <llvm/Support/raw_ostream.h>
    26 
     7#include "toolchain.h"
     8#include <llvm/CodeGen/CommandFlags.h>             // for InitTargetOptionsF...
     9#include <llvm/ExecutionEngine/ExecutionEngine.h>  // for EngineBuilder
     10#include <llvm/Support/CommandLine.h>              // for OptionCategory
     11#include <llvm/Support/TargetSelect.h>             // for InitializeNativeTa...
     12#include <llvm/Support/raw_ostream.h>              // for errs, raw_ostream
     13#include <llvm/ADT/SmallString.h>                  // for SmallString
     14#include <llvm/IR/LegacyPassManager.h>             // for PassManager
     15#include <llvm/InitializePasses.h>                 // for initializeCodeGen
     16#include <llvm/PassRegistry.h>                     // for PassRegistry
     17#include <llvm/Support/CodeGen.h>                  // for Level, Level::None
     18#include <llvm/Support/Compiler.h>                 // for LLVM_UNLIKELY
     19#include <llvm/Target/TargetMachine.h>             // for TargetMachine, Tar...
     20#include <llvm/Target/TargetOptions.h>             // for TargetOptions
    2721#include <object_cache.h>
    28 
     22namespace llvm { class Module; }
    2923#ifdef CUDA_ENABLED
    3024#include <IR_Gen/llvm2ptx.h>
     
    192186    }
    193187#if LLVM_VERSION_MINOR > 6
    194 
    195188    if (codegen::DumpASM) {
    196189      WriteAssembly(builder.selectTarget(), m);
  • icGREP/icgrep-devel/icgrep/toolchain.h

    r5165 r5267  
    88#define TOOLCHAIN_H
    99
    10 #include <llvm/IR/Module.h>
    11 #include <llvm/ExecutionEngine/ExecutionEngine.h>
    12 #include <llvm/Support/CommandLine.h>
     10namespace llvm { class ExecutionEngine; }
     11namespace llvm { class Module; }
     12namespace llvm { namespace cl { class OptionCategory; } }
    1313
    1414namespace codegen {
  • icGREP/icgrep-devel/icgrep/u8u16.cpp

    r5260 r5267  
    55 */
    66
    7 #include <string>
     7#include <IR_Gen/idisa_builder.h>                  // for IDISA_Builder
     8#include <IR_Gen/idisa_target.h>                   // for GetIDISA_Builder
     9#include <cc/cc_compiler.h>                        // for CC_Compiler
     10#include <kernels/deletion.h>                      // for DeletionKernel
     11#include <kernels/mmap_kernel.h>                   // for MMapSourceKernel
     12#include <kernels/p2s_kernel.h>                    // for P2S16KernelWithCom...
     13#include <kernels/s2p_kernel.h>                    // for S2PKernel
     14#include <kernels/stdout_kernel.h>                 // for StdOutKernel
     15#include <llvm/ExecutionEngine/ExecutionEngine.h>  // for ExecutionEngine
     16#include <llvm/IR/Function.h>                      // for Function, Function...
     17#include <llvm/IR/Module.h>                        // for Module
     18#include <llvm/IR/Verifier.h>                      // for verifyModule
     19#include <llvm/Support/CommandLine.h>              // for ParseCommandLineOp...
     20#include <llvm/Support/Debug.h>                    // for dbgs
     21#include <pablo/pablo_kernel.h>                    // for PabloKernel
     22#include <pablo/pablo_toolchain.h>                 // for pablo_function_passes
     23#include <pablo/pe_zeroes.h>
     24#include <toolchain.h>                             // for JIT_to_ExecutionEn...
     25#include <boost/iostreams/device/mapped_file.hpp>  // for mapped_file_source
     26#include <boost/filesystem.hpp>
     27#include <boost/interprocess/anonymous_shared_memory.hpp>
     28#include "kernels/streamset.h"                     // for CircularBuffer
     29#include <kernels/pipeline.h>
     30#include "llvm/ADT/StringRef.h"                    // for StringRef
     31#include "llvm/IR/CallingConv.h"                   // for ::C
     32#include "llvm/IR/DerivedTypes.h"                  // for ArrayType, Pointer...
     33#include "llvm/IR/LLVMContext.h"                   // for LLVMContext
     34#include "llvm/IR/Value.h"                         // for Value
     35#include "llvm/Support/Compiler.h"                 // for LLVM_UNLIKELY
     36#include <pablo/builder.hpp>                       // for PabloBuilder
    837#include <iostream>
    9 #include <fstream>
    10 #include <sstream>
    11 #include <stdlib.h>
    12 
    13 #include <llvm/IR/Function.h>
    14 #include <llvm/IR/Module.h>
    15 #include <llvm/ExecutionEngine/ExecutionEngine.h>
    16 #include <llvm/ExecutionEngine/MCJIT.h>
    17 #include <llvm/IRReader/IRReader.h>
    18 #include <llvm/IR/Verifier.h>
    19 #include <llvm/Support/Debug.h>
    20 
    21 #include <llvm/Support/CommandLine.h>
    22 
    23 #include <toolchain.h>
    24 #include <re/re_cc.h>
    25 #include <cc/cc_compiler.h>
    26 #include <pablo/pablo_toolchain.h>
    27 #include <pablo/pablo_kernel.h>
    28 #include <IR_Gen/idisa_builder.h>
    29 #include <IR_Gen/idisa_target.h>
    30 #include <kernels/pipeline.h>
    31 #include <kernels/mmap_kernel.h>
    32 #include <kernels/interface.h>
    33 #include <kernels/kernel.h>
    34 #include <kernels/s2p_kernel.h>
    35 #include <kernels/p2s_kernel.h>
    36 #include <kernels/deletion.h>
    37 #include <kernels/stdout_kernel.h>
    38 
    39 // mmap system
    40 #include <boost/filesystem.hpp>
    41 #include <boost/iostreams/device/mapped_file.hpp>
    42 #include <boost/interprocess/anonymous_shared_memory.hpp>
    43 #include <boost/interprocess/mapped_region.hpp>
    44 #include <fcntl.h>
    45 static cl::OptionCategory u8u16Options("u8u16 Options",
    46                                             "Transcoding control options.");
    47 
     38
     39using namespace pablo;
     40using namespace kernel;
     41using namespace parabix;
     42using namespace llvm;
     43
     44static cl::OptionCategory u8u16Options("u8u16 Options", "Transcoding control options.");
    4845static cl::list<std::string> inputFiles(cl::Positional, cl::desc("<input file ...>"), cl::OneOrMore, cl::cat(u8u16Options));
    49 
    5046static cl::opt<bool> segmentPipelineParallel("enable-segment-pipeline-parallel", cl::desc("Enable multithreading with segment pipeline parallelism."), cl::cat(u8u16Options));
    5147static cl::opt<bool> mMapBuffering("mmap-buffering", cl::desc("Enable mmap buffering."), cl::cat(u8u16Options));
     
    5349
    5450
    55 using namespace pablo;
    56 using namespace kernel;
    57 using namespace parabix;
    58 
    5951void u8u16_pablo(PabloKernel * kernel) {
    6052    //  input: 8 basis bit streams
     
    6658    const auto u8_bits = ccc.getBasisBits();
    6759
    68     PabloAST * zeroes = main.createZeroes();
     60    Zeroes * zeroes = main.createZeroes();
    6961
    7062    // Outputs
  • icGREP/icgrep-devel/icgrep/wc.cpp

    r5255 r5267  
    55 */
    66
    7 #include <string>
    87#include <iostream>
    98#include <iomanip>
    10 #include <fstream>
    119#include <sstream>
    12 
    13 
    1410#include <toolchain.h>
    15 #include <pablo/pablo_toolchain.h>
    1611#include <llvm/IR/Function.h>
    1712#include <llvm/IR/Module.h>
    1813#include <llvm/ExecutionEngine/ExecutionEngine.h>
    19 #include <llvm/ExecutionEngine/MCJIT.h>
    2014#include "llvm/Linker/Linker.h"
    21 
    2215#include <llvm/Support/CommandLine.h>
    2316#include <llvm/Support/raw_ostream.h>
    24 
    25 #include <re/re_cc.h>
    2617#include <cc/cc_compiler.h>
    2718#include <pablo/pablo_kernel.h>
     
    2920#include <IR_Gen/idisa_target.h>
    3021#include <kernels/streamset.h>
    31 #include <kernels/interface.h>
    32 #include <kernels/kernel.h>
    3322#include <kernels/mmap_kernel.h>
    3423#include <kernels/s2p_kernel.h>
    3524#include <kernels/pipeline.h>
    36 
    3725#include <pablo/pablo_compiler.h>
    3826#include <pablo/pablo_toolchain.h>
    39 
    40 // mmap system
    4127#include <boost/filesystem.hpp>
    4228#include <boost/iostreams/device/mapped_file.hpp>
    4329
    44 #include <fcntl.h>
     30
     31using namespace llvm;
    4532
    4633static cl::OptionCategory wcFlags("Command Flags", "wc options");
Note: See TracChangeset for help on using the changeset viewer.