Changeset 6263


Ignore:
Timestamp:
Jan 2, 2019, 1:57:02 PM (3 months ago)
Author:
cameron
Message:

getPThreadTy()

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

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/IR_Gen/CBuilder.cpp

    r6261 r6263  
    787787}
    788788
     789Type * CBuilder::getPThreadTy() {
     790    return getSizeTy();//TypeBuilder<pthread_t, false>::get(getContext());
     791}
     792
    789793Value * CBuilder::CreatePThreadCreateCall(Value * thread, Value * attr, Function * start_routine, Value * arg) {
    790794    Module * const m = getModule();
     
    792796    Function * pthreadCreateFunc = m->getFunction("pthread_create");
    793797    if (pthreadCreateFunc == nullptr) {
    794         Type * const pthreadTy = TypeBuilder<pthread_t, false>::get(getContext());
    795798        FunctionType * funVoidPtrVoidTy = FunctionType::get(getVoidTy(), {voidPtrTy}, false);
    796         FunctionType * fty = FunctionType::get(getInt32Ty(), {pthreadTy->getPointerTo(), voidPtrTy, funVoidPtrVoidTy->getPointerTo(), voidPtrTy}, false);
     799        FunctionType * fty = FunctionType::get(getInt32Ty(), {getPThreadTy()->getPointerTo(), voidPtrTy, funVoidPtrVoidTy->getPointerTo(), voidPtrTy}, false);
    797800        pthreadCreateFunc = Function::Create(fty, Function::ExternalLinkage, "pthread_create", m);
    798801        pthreadCreateFunc->setCallingConv(CallingConv::C);
     
    830833    Function * pthreadJoinFunc = m->getFunction("pthread_join");
    831834    if (pthreadJoinFunc == nullptr) {
    832         Type * const pthreadTy = TypeBuilder<pthread_t, false>::get(getContext());
    833         FunctionType * fty = FunctionType::get(getInt32Ty(), {pthreadTy, getVoidPtrTy()->getPointerTo()}, false);
     835        FunctionType * fty = FunctionType::get(getInt32Ty(), {getPThreadTy(), getVoidPtrTy()->getPointerTo()}, false);
    834836        pthreadJoinFunc = Function::Create(fty, Function::ExternalLinkage, "pthread_join", m);
    835837        pthreadJoinFunc->setCallingConv(CallingConv::C);
  • icGREP/icgrep-devel/icgrep/IR_Gen/CBuilder.h

    r6241 r6263  
    210210    //  Posix thread (pthread.h) functions.
    211211    //
     212    llvm::Type * getPThreadTy();
    212213    //  Create a call to:  int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
    213214    //                    void *(*start_routine)(void*), void *arg);
  • icGREP/icgrep-devel/icgrep/kernels/pipeline/pipeline_logic.hpp

    r6262 r6263  
    170170    // (n - 1) threads to handle the subsequent offsets
    171171    const unsigned threads = numOfThreads - 1;
    172     Type * const pthreadTy = TypeBuilder<pthread_t, false>::get(b->getContext());
    173     Type * const pthreadsTy = ArrayType::get(pthreadTy, threads);
     172    Type * const pthreadsTy = ArrayType::get(b->getPThreadTy(), threads);
    174173    AllocaInst * const pthreads = b->CreateCacheAlignedAlloca(pthreadsTy);
    175174    std::vector<Value *> threadIdPtr(threads);
Note: See TracChangeset for help on using the changeset viewer.