Changeset 5010


Ignore:
Timestamp:
Apr 9, 2016, 2:13:20 PM (20 months ago)
Author:
nmedfort
Message:

Fix for u8u16

Location:
icGREP/icgrep-devel/icgrep
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/kernels/casefold_pipeline.cpp

    r5000 r5010  
    9696
    9797    Instance * s2pInstance = mS2PKernel->instantiate(inputStream);
    98     Instance * caseFoldInstance = mCaseFoldKernel->instantiate(s2pInstance->getResultSet());
    99     Instance * p2sInstance = mP2SKernel->instantiate(caseFoldInstance->getResultSet());
    100     Instance * stdOutInstance = mStdOutKernel->instantiate(p2sInstance->getResultSet());
     98    Instance * caseFoldInstance = mCaseFoldKernel->instantiate(s2pInstance->getOutputStreamBuffer());
     99    Instance * p2sInstance = mP2SKernel->instantiate(caseFoldInstance->getOutputStreamBuffer());
     100    Instance * stdOutInstance = mStdOutKernel->instantiate(p2sInstance->getOutputStreamBuffer());
    101101
    102102    stdOutInstance->setInternalState("RemainingBytes", bufferSize);  // The total number of bytes to be sent to stdout.
  • icGREP/icgrep-devel/icgrep/kernels/instance.h

    r5008 r5010  
    6969    }
    7070
     71
    7172    inline llvm::Value * getOutputStreamSet(const unsigned streamOffset = 0) {
     73        // do not pass the result of this into an instantiate method; instead call getOutputStreamBuffer.
    7274        return getStreamSet(mDefinition->getOutputStreamType(), mOutputStreamSet, streamOffset, mOutputBufferSize);
    7375    }
     
    9597    }
    9698
    97     inline std::pair<llvm::Value *, unsigned> getResultSet() const {
     99    inline std::pair<llvm::Value *, unsigned> getOutputStreamBuffer() const {
    98100        return std::make_pair(mOutputStreamSet, mOutputBufferSize);
    99101    }
  • icGREP/icgrep-devel/icgrep/kernels/pipeline.cpp

    r5001 r5010  
    9696
    9797    Instance * s2pInstance = mS2PKernel->instantiate(inputStream);
    98     Instance * icGrepInstance = mICgrepKernel->instantiate(s2pInstance->getResultSet());
    99     Instance * scanMatchInstance = mScanMatchKernel->instantiate(icGrepInstance->getResultSet());
     98    Instance * icGrepInstance = mICgrepKernel->instantiate(s2pInstance->getOutputStreamBuffer());
     99    Instance * scanMatchInstance = mScanMatchKernel->instantiate(icGrepInstance->getOutputStreamBuffer());
    100100
    101101    scanMatchInstance->setInternalState("FileBuf", iBuilder->CreateBitCast(inputStream, int8PtrTy));
  • icGREP/icgrep-devel/icgrep/kernels/symboltablepipeline.cpp

    r5008 r5010  
    676676
    677677    Instance * s2pInstance = mS2PKernel->instantiate(inputStream);
    678     Instance * leadingInstance = mLeadingKernel->instantiate(s2pInstance->getResultSet());
    679     Instance * sortingInstance = mSortingKernel->instantiate(leadingInstance->getResultSet());
    680     Instance * gatheringInstance = mGatherKernel->instantiate(sortingInstance->getResultSet());
     678    Instance * leadingInstance = mLeadingKernel->instantiate(s2pInstance->getOutputStreamBuffer());
     679    Instance * sortingInstance = mSortingKernel->instantiate(leadingInstance->getOutputStreamBuffer());
     680    Instance * gatheringInstance = mGatherKernel->instantiate(sortingInstance->getOutputStreamBuffer());
    681681
    682682    gatheringInstance->setInternalState("Base", iBuilder->CreateBitCast(inputStream, iBuilder->getInt8PtrTy()));
  • icGREP/icgrep-devel/icgrep/kernels/u8u16_pipeline.cpp

    r5009 r5010  
    100100
    101101    Instance * s2pInstance = mS2PKernel->instantiate(inputStream);
    102     Instance * u8u16Instance = mU8U16Kernel->instantiate(s2pInstance->getOutputStreamSet());
    103     Instance * delInstance = mDelKernel->instantiate(u8u16Instance->getOutputStreamSet());
    104     Instance * p2sInstance = mP2SKernel->instantiate(delInstance->getOutputStreamSet());
     102    Instance * u8u16Instance = mU8U16Kernel->instantiate(s2pInstance->getOutputStreamBuffer());
     103    Instance * delInstance = mDelKernel->instantiate(u8u16Instance->getOutputStreamBuffer());
     104    Instance * p2sInstance = mP2SKernel->instantiate(delInstance->getOutputStreamBuffer());
    105105
    106106   
     
    174174    iBuilder->SetInsertPoint(endBlock);
    175175
     176    Value * const delmaskPtr = u8u16Instance->getOutputStream(16);
    176177    u8u16Instance->CreateDoBlockCall();
    177178    Value * remaining = iBuilder->CreateZExt(remainingBytes, iBuilder->getIntNTy(mBlockSize));
    178179    Value * EOF_del = iBuilder->bitCast(iBuilder->CreateShl(Constant::getAllOnesValue(iBuilder->getIntNTy(mBlockSize)), remaining));
    179     Value * const delmask = u8u16Instance->getOutputStream(16);
    180     iBuilder->CreateBlockAlignedStore(iBuilder->CreateOr(EOF_del, iBuilder->CreateBlockAlignedLoad(delmask)), delmask);
     180    Value * const delmaskVal = iBuilder->CreateBlockAlignedLoad(delmaskPtr);
     181    iBuilder->CreateBlockAlignedStore(iBuilder->CreateOr(EOF_del, delmaskVal), delmaskPtr);
    181182    delInstance->CreateDoBlockCall();
    182183    p2sInstance->CreateDoBlockCall();
  • icGREP/icgrep-devel/icgrep/kernels/u8u16_pipeline.h

    r5005 r5010  
    4040    KernelBuilder *                     mDelKernel;
    4141    KernelBuilder *                     mP2SKernel;
    42     KernelBuilder *                     mStdOutKernel;
     42    //KernelBuilder *                     mStdOutKernel;
    4343    llvm::Type*                         mBitBlockType;
    4444    int                                 mBlockSize;
  • icGREP/icgrep-devel/icgrep/u8u16.cpp

    r5007 r5010  
    277277typedef void (*u8u16FunctionType)(char * byte_data, size_t filesize);
    278278
     279static ExecutionEngine * u8u16Engine = nullptr;
     280
    279281u8u16FunctionType u8u16CodeGen(void) {
    280282                           
     
    300302    verifyModule(*M, &dbgs());
    301303    //std::cerr << "ExecuteKernels(); done\n";
    302     ExecutionEngine * mEngine = JIT_to_ExecutionEngine(M);
    303    
    304     mEngine->finalizeObject();
     304    u8u16Engine = JIT_to_ExecutionEngine(M);
     305   
     306    u8u16Engine->finalizeObject();
    305307    //std::cerr << "finalizeObject(); done\n";
    306308
    307309    delete idb;
    308     return reinterpret_cast<u8u16FunctionType>(mEngine->getPointerToFunction(main_IR));
     310    return reinterpret_cast<u8u16FunctionType>(u8u16Engine->getPointerToFunction(main_IR));
    309311}
    310312
     
    383385    }
    384386
     387    delete u8u16Engine;
     388
    385389    return 0;
    386390}
Note: See TracChangeset for help on using the changeset viewer.