Ignore:
Timestamp:
Jan 27, 2017, 2:22:06 PM (2 years ago)
Author:
nmedfort
Message:

Optimized Symbol Generation (and fixed potential bug that could allow duplicate names being constructed); made PabloKernel? extend PabloAST (temporarily removed PabloAST::getName() to avoid diamond problem); added an internal scalar to PabloKernel? struct for each Count to avoid InOut? output scalar variable problem; allowed CodeMotionPass? to move code within the same scope but across a branch statement. Began work on separating Kernels into either Block-Oriented or Segment-Oriented kernels.

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

Legend:

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

    r5281 r5283  
    164164}
    165165
    166 void CBuilder::CreateAlignedFree(Value * const ptr, const bool ptrMayBeNull) {
    167     // WARNING: this will cause a segfault if the value of the ptr at runtime is null but ptrMayBeNull was not set
     166void CBuilder::CreateAlignedFree(Value * const ptr, const bool testForNullAddress) {
     167    // WARNING: this will segfault if the value of the ptr at runtime is null but testForNullAddress was not set
    168168    PointerType * type = cast<PointerType>(ptr->getType());
    169169    BasicBlock * exit = nullptr;
    170     if (ptrMayBeNull) {
     170    if (testForNullAddress) {
    171171        LLVMContext & C = getContext();
    172172        BasicBlock * bb = GetInsertBlock();
     
    186186    prefix = CreateIntToPtr(CreateAlignedLoad(prefix, byteWidth), type);
    187187    CreateFree(prefix);
    188     if (ptrMayBeNull) {
     188    if (testForNullAddress) {
    189189        CreateBr(exit);
    190190        SetInsertPoint(exit);
     
    242242
    243243LoadInst * CBuilder::CreateAtomicLoadAcquire(Value * ptr) {
    244     unsigned alignment = dyn_cast<PointerType>(ptr->getType())->getElementType()->getPrimitiveSizeInBits()/8;
     244    unsigned alignment = cast<PointerType>(ptr->getType())->getElementType()->getPrimitiveSizeInBits() / 8;
    245245    LoadInst * inst = CreateAlignedLoad(ptr, alignment);
    246246    inst->setOrdering(AtomicOrdering::Acquire);
     
    249249}
    250250StoreInst * CBuilder::CreateAtomicStoreRelease(Value * val, Value * ptr) {
    251     unsigned alignment = dyn_cast<PointerType>(ptr->getType())->getElementType()->getPrimitiveSizeInBits()/8;
     251    unsigned alignment = cast<PointerType>(ptr->getType())->getElementType()->getPrimitiveSizeInBits() / 8;
    252252    StoreInst * inst = CreateAlignedStore(val, ptr, alignment);
    253253    inst->setOrdering(AtomicOrdering::Release);
  • icGREP/icgrep-devel/icgrep/IR_Gen/CBuilder.h

    r5281 r5283  
    3838    void CreateFree(llvm::Value * const ptr);
    3939   
    40     void CreateAlignedFree(llvm::Value * const ptr, const bool ptrMayBeNull = false);
     40    void CreateAlignedFree(llvm::Value * const ptr, const bool testForNullAddress = false);
    4141   
    4242    llvm::Value * CreateRealloc(llvm::Value * ptr, llvm::Value * size);
Note: See TracChangeset for help on using the changeset viewer.