Changeset 5465 for icGREP/icgrep-devel


Ignore:
Timestamp:
May 22, 2017, 1:01:12 PM (2 years ago)
Author:
nmedfort
Message:

Jenkins investigation check-in

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

Legend:

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

    r5464 r5465  
    189189SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
    190190
     191include(CheckFunctionExists)
     192CHECK_FUNCTION_EXISTS(aligned_alloc STDLIB_HAS_ALIGNED_ALLOC)
     193IF (STDLIB_HAS_ALIGNED_ALLOC)
     194SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTDLIB_HAS_ALIGNED_ALLOC")
     195ENDIF()
     196
     197
    191198SET(CMAKE_REQUIRED_FLAGS)
    192199
  • icGREP/icgrep-devel/icgrep/IR_Gen/CBuilder.cpp

    r5464 r5465  
    243243    }
    244244    Module * const m = getModule();
    245     Function * aligned_malloc = m->getFunction("aligned_alloc");
     245    Function * f = m->getFunction("aligned_alloc");
    246246    IntegerType * const sizeTy = getSizeTy();
    247     if (LLVM_UNLIKELY(aligned_malloc == nullptr)) {
    248         PointerType * const voidPtrTy = getVoidPtrTy();
    249         FunctionType * const fty = FunctionType::get(voidPtrTy, {sizeTy, sizeTy}, false);
    250         aligned_malloc = Function::Create(fty, Function::ExternalLinkage, "aligned_alloc", m);
    251         aligned_malloc->setCallingConv(CallingConv::C);
    252         aligned_malloc->setDoesNotAlias(0);
    253 
    254         // aligned_malloc = LinkFunction("aligned_alloc", &aligned_alloc);
     247    if (LLVM_UNLIKELY(f == nullptr)) {
     248//        PointerType * const voidPtrTy = getVoidPtrTy();
     249//        FunctionType * const fty = FunctionType::get(voidPtrTy, {sizeTy, sizeTy}, false);
     250//        f = Function::Create(fty, Function::ExternalLinkage, "aligned_alloc", m);
     251//        f->setCallingConv(CallingConv::C);
     252//        f->setDoesNotAlias(0);
     253        f = LinkFunction("aligned_alloc", &aligned_alloc);
    255254    }
    256255
     
    261260                     "CreateAlignedMalloc: size must be an integral multiple of alignment.");
    262261    }
    263     Value * const ptr = CreateCall(aligned_malloc, {align, size});
     262    Value * const ptr = CreateCall(f, {align, size});
    264263    CreateAssert(ptr, "CreateAlignedMalloc: returned null pointer.");
    265264    return ptr;
Note: See TracChangeset for help on using the changeset viewer.