Changeset 5175


Ignore:
Timestamp:
Oct 3, 2016, 8:45:02 PM (3 years ago)
Author:
cameron
Message:

Some tidy ups and changes to prepare for LLVM 3.9

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

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/IDISA/idisa_nvptx_builder.h

    r5165 r5175  
    1818   
    1919    IDISA_NVPTX20_Builder(Module * m, int groupSize)
    20     : IDISA_I64_Builder(m, VectorType::get(IntegerType::get(getGlobalContext(), 64), 1))
     20    : IDISA_I64_Builder(m, VectorType::get(IntegerType::get(m->getContext(), 64), 1))
    2121    , groupThreads(groupSize)
    2222    {
  • icGREP/icgrep-devel/icgrep/IDISA/idisa_target.cpp

    r5151 r5175  
    2121        theBlockSize = hasAVX2 ? 256 : 128;
    2222    }
    23     Type * bitBlockType = VectorType::get(IntegerType::get(getGlobalContext(), 64), theBlockSize/64);
     23    Type * bitBlockType = VectorType::get(IntegerType::get(mod->getContext(), 64), theBlockSize/64);
    2424   
    2525    int blockSize = bitBlockType->isIntegerTy() ? cast<IntegerType>(bitBlockType)->getIntegerBitWidth() : cast<VectorType>(bitBlockType)->getBitWidth();
  • icGREP/icgrep-devel/icgrep/kernels/kernel.cpp

    r5174 r5175  
    4949    int streamSetNo = 0;
    5050    for (unsigned i = 0; i < mStreamSetInputs.size(); i++) {
    51         size_t bufferSize = mStreamSetInputBuffers[i]->getBufferSize() * blockSize;
    5251        if (!(mStreamSetInputBuffers[i]->getBufferStreamSetType() == mStreamSetInputs[i].ssType)) {
    5352             llvm::report_fatal_error("Kernel preparation: Incorrect input buffer type");
     
    7877        addScalar(binding.scalarType, binding.scalarName);
    7978    }
    80     mKernelStateType = StructType::create(getGlobalContext(), mKernelFields, mKernelName);
     79    mKernelStateType = StructType::create(iBuilder->getContext(), mKernelFields, mKernelName);
    8180}
    8281
     
    8483    Module * saveModule = iBuilder->getModule();
    8584    IDISA::IDISA_Builder::InsertPoint savePoint = iBuilder->saveIP();
    86     std::unique_ptr<Module> theModule = make_unique<Module>(mKernelName + "_" + iBuilder->getBitBlockTypeName(), getGlobalContext());
     85    std::unique_ptr<Module> theModule = make_unique<Module>(mKernelName + "_" + iBuilder->getBitBlockTypeName(), iBuilder->getContext());
    8786    Module * m = theModule.get();
    8887    iBuilder->setModule(m);
     
    222221    Value * ptr = iBuilder->CreateGEP(self, {iBuilder->getInt32(0), getScalarIndex(logicalSegmentNoScalar)});
    223222    LoadInst * segNo = iBuilder->CreateAlignedLoad(ptr, sizeof(size_t));
    224     segNo->setOrdering(Acquire);
     223    segNo->setOrdering(AtomicOrdering::Acquire);
    225224    return segNo;
    226225}
     
    242241void KernelBuilder::setLogicalSegmentNo(Value * self, Value * newCount) {
    243242    Value * ptr = iBuilder->CreateGEP(self, {iBuilder->getInt32(0), getScalarIndex(logicalSegmentNoScalar)});
    244     iBuilder->CreateAlignedStore(newCount, ptr, sizeof(size_t))->setOrdering(Release);
     243    iBuilder->CreateAlignedStore(newCount, ptr, sizeof(size_t))->setOrdering(AtomicOrdering::Release);
    245244}
    246245
     
    396395    for (unsigned i = 0; i < outbufProducerPtrs.size(); i++) {
    397396        LoadInst * producerPos = iBuilder->CreateAlignedLoad(outbufProducerPtrs[i], sizeof(size_t));
    398         producerPos->setOrdering(Acquire);
     397        producerPos->setOrdering(AtomicOrdering::Acquire);
    399398        // iBuilder->CallPrintInt(name + ":output producerPos", producerPos);
    400399        LoadInst * consumerPos = iBuilder->CreateAlignedLoad(outbufConsumerPtrs[i], sizeof(size_t));
    401         consumerPos->setOrdering(Acquire);
     400        consumerPos->setOrdering(AtomicOrdering::Acquire);
    402401        // iBuilder->CallPrintInt(name + ":output consumerPos", consumerPos);
    403402        waitCondTest = iBuilder->CreateAnd(waitCondTest, iBuilder->CreateICmpULE(producerPos, iBuilder->CreateAdd(consumerPos, bufferSize)));
     
    415414    for (unsigned i = 0; i < inbufProducerPtrs.size(); i++) {
    416415        LoadInst * producerPos = iBuilder->CreateAlignedLoad(inbufProducerPtrs[i], sizeof(size_t));
    417         producerPos->setOrdering(Acquire);
     416        producerPos->setOrdering(AtomicOrdering::Acquire);
    418417        // iBuilder->CallPrintInt(name + ":input producerPos", producerPos);
    419418        LoadInst * consumerPos = iBuilder->CreateAlignedLoad(inbufConsumerPtrs[i], sizeof(size_t));
    420         consumerPos->setOrdering(Acquire);
     419        consumerPos->setOrdering(AtomicOrdering::Acquire);
    421420        // iBuilder->CallPrintInt(name + ":input consumerPos", consumerPos);
    422421        waitCondTest = iBuilder->CreateAnd(waitCondTest, iBuilder->CreateICmpULE(iBuilder->CreateAdd(consumerPos, requiredSize), producerPos));
     
    429428    LoadInst * endSignal = iBuilder->CreateAlignedLoad(endSignalPtrs[0], sizeof(size_t));
    430429    // iBuilder->CallPrintInt(name + ":endSignal", endSignal);
    431     endSignal->setOrdering(Acquire);
     430    endSignal->setOrdering(AtomicOrdering::Acquire);
    432431    for (unsigned i = 1; i < endSignalPtrs.size(); i++){
    433432        LoadInst * endSignal_next = iBuilder->CreateAlignedLoad(endSignalPtrs[i], sizeof(size_t));
    434         endSignal_next->setOrdering(Acquire);
     433        endSignal_next->setOrdering(AtomicOrdering::Acquire);
    435434        iBuilder->CreateAnd(endSignal, endSignal_next);
    436435    }
     
    444443    for (unsigned i = 0; i < inbufConsumerPtrs.size(); i++) {
    445444        Value * consumerPos = iBuilder->CreateAdd(iBuilder->CreateLoad(inbufConsumerPtrs[i]), segSize);
    446         iBuilder->CreateAlignedStore(consumerPos, inbufConsumerPtrs[i], sizeof(size_t))->setOrdering(Release);
     445        iBuilder->CreateAlignedStore(consumerPos, inbufConsumerPtrs[i], sizeof(size_t))->setOrdering(AtomicOrdering::Release);
    447446    }
    448447   
    449448    Value * produced = getProducedItemCount(self);
    450449    for (unsigned i = 0; i < outbufProducerPtrs.size(); i++) {
    451         iBuilder->CreateAlignedStore(produced, outbufProducerPtrs[i], sizeof(size_t))->setOrdering(Release);
     450        iBuilder->CreateAlignedStore(produced, outbufProducerPtrs[i], sizeof(size_t))->setOrdering(AtomicOrdering::Release);
    452451    }
    453452   
     
    487486    for (unsigned i = 0; i < inbufConsumerPtrs.size(); i++) {
    488487        Value * consumerPos = iBuilder->CreateAdd(iBuilder->CreateLoad(inbufConsumerPtrs[i]), remainingBytes);
    489         iBuilder->CreateAlignedStore(consumerPos, inbufConsumerPtrs[i], sizeof(size_t))->setOrdering(Release);
     488        iBuilder->CreateAlignedStore(consumerPos, inbufConsumerPtrs[i], sizeof(size_t))->setOrdering(AtomicOrdering::Release);
    490489    }
    491490    for (unsigned i = 0; i < outbufProducerPtrs.size(); i++) {
    492        
    493         Value * produced = iBuilder->CreateAdd(iBuilder->CreateLoad(outbufProducerPtrs[i]), remainingBytes);
    494         iBuilder->CreateAlignedStore(producerPos, outbufProducerPtrs[i], sizeof(size_t))->setOrdering(Release);
     491        iBuilder->CreateAlignedStore(producerPos, outbufProducerPtrs[i], sizeof(size_t))->setOrdering(AtomicOrdering::Release);
    495492    }
    496493
  • icGREP/icgrep-devel/icgrep/kernels/pipeline.cpp

    r5174 r5175  
    3434    input->setName("input");
    3535
    36     int threadNum = codegen::ThreadNum;
     36    unsigned threadNum = codegen::ThreadNum;
    3737
    3838     // Create the basic blocks for the thread function.
     
    136136void generateSegmentParallelPipeline(IDISA::IDISA_Builder * iBuilder, std::vector<KernelBuilder *> kernels, std::vector<Value *> instances, Value * fileSize) {
    137137   
    138     int threadNum = codegen::ThreadNum;
     138    unsigned threadNum = codegen::ThreadNum;
    139139
    140140    Module * m = iBuilder->getModule();
  • icGREP/icgrep-devel/icgrep/kernels/streamset.h

    r5174 r5175  
    8585    SingleBlockBuffer(IDISA::IDISA_Builder * b, StreamSetType ss_type) :
    8686    StreamSetBuffer(BufferKind::BlockBuffer, b, ss_type) {
    87         mStreamSetStructType = StructType::get(getGlobalContext(),
     87        mStreamSetStructType = StructType::get(iBuilder->getContext(),
    8888                                               std::vector<Type *>({iBuilder->getSizeTy(),
    8989                                                                    iBuilder->getSizeTy(),
     
    106106            mBufferBlocks = 0;
    107107            mAddrSpace = AddressSpace;
    108             mStreamSetStructType = StructType::get(getGlobalContext(),
     108            mStreamSetStructType = StructType::get(iBuilder->getContext(),
    109109                                                   std::vector<Type *>({iBuilder->getSizeTy(),
    110110                                                                        iBuilder->getSizeTy(),
     
    135135                throw std::runtime_error("CircularStreamSetBuffer: number of blocks must be a power of 2!");
    136136            }
    137             mStreamSetStructType = StructType::get(getGlobalContext(),
     137            mStreamSetStructType = StructType::get(iBuilder->getContext(),
    138138                                                   std::vector<Type *>({iBuilder->getSizeTy(),
    139139                                                                        iBuilder->getSizeTy(),
  • icGREP/icgrep-devel/icgrep/toolchain.cpp

    r5165 r5175  
    2626
    2727#include <object_cache.h>
     28
     29#ifdef CUDA_ENABLED
    2830#include <IDISA/llvm2ptx.h>
     31#endif
    2932 
    3033using namespace llvm;
Note: See TracChangeset for help on using the changeset viewer.