Ignore:
Timestamp:
Mar 10, 2016, 4:10:02 PM (3 years ago)
Author:
nmedfort
Message:

Some fixes for threading and kernel builder.

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

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/carry_manager.cpp

    r4959 r4968  
    190190        // special case using a single buffer entry and the carry_out value.
    191191        Value * advanceDataPtr = iBuilder->CreateGEP(mCarryBitBlockPtr, advBaseIndex);
    192         Value * carry_block0 = iBuilder->CreateAlignedLoad(advanceDataPtr, mBitBlockWidth/8);
    193         iBuilder->CreateAlignedStore(value, advanceDataPtr, mBitBlockWidth/8);
     192        Value * carry_block0 = iBuilder->CreateBlockAlignedLoad(advanceDataPtr);
     193        iBuilder->CreateBlockAlignedStore(value, advanceDataPtr);
    194194        /* Very special case - no combine */
    195195        if (shiftAmount == mBitBlockWidth) {
     
    207207    Value * loadIndex0 = iBuilder->CreateAdd(iBuilder->CreateAnd(iBuilder->CreateSub(mBlockNo, iBuilder->getInt64(advanceEntries)), indexMask), advBaseIndex);
    208208    Value * storeIndex = iBuilder->CreateAdd(iBuilder->CreateAnd(mBlockNo, indexMask), advBaseIndex);
    209     Value * carry_block0 = iBuilder->CreateAlignedLoad(iBuilder->CreateGEP(mCarryBitBlockPtr, loadIndex0), mBitBlockWidth/8);
     209    Value * carry_block0 = iBuilder->CreateBlockAlignedLoad(iBuilder->CreateGEP(mCarryBitBlockPtr, loadIndex0));
    210210    // If the long advance is an exact multiple of mBITBLOCK_WIDTH, we simply return the oldest
    211211    // block in the long advance carry data area. 
    212212    if (block_shift == 0) {
    213         iBuilder->CreateAlignedStore(value, iBuilder->CreateGEP(mCarryBitBlockPtr, storeIndex), mBitBlockWidth/8);
     213        iBuilder->CreateBlockAlignedStore(value, iBuilder->CreateGEP(mCarryBitBlockPtr, storeIndex));
    214214        return carry_block0;
    215215    }
    216216    // Otherwise we need to combine data from the two oldest blocks.
    217217    Value * loadIndex1 = iBuilder->CreateAdd(iBuilder->CreateAnd(iBuilder->CreateSub(mBlockNo, iBuilder->getInt64(advanceEntries-1)), indexMask), advBaseIndex);
    218     Value * carry_block1 = iBuilder->CreateAlignedLoad(iBuilder->CreateGEP(mCarryBitBlockPtr, loadIndex1), mBitBlockWidth/8);
     218    Value * carry_block1 = iBuilder->CreateBlockAlignedLoad(iBuilder->CreateGEP(mCarryBitBlockPtr, loadIndex1));
    219219    Value* block0_shr = iBuilder->CreateLShr(iBuilder->CreateBitCast(carry_block0, iBuilder->getIntNTy(mBitBlockWidth)), mBitBlockWidth - block_shift);
    220220    Value* block1_shl = iBuilder->CreateShl(iBuilder->CreateBitCast(carry_block1, iBuilder->getIntNTy(mBitBlockWidth)), block_shift);
    221     iBuilder->CreateAlignedStore(value, iBuilder->CreateGEP(mCarryBitBlockPtr, storeIndex), mBitBlockWidth/8);
     221    iBuilder->CreateBlockAlignedStore(value, iBuilder->CreateGEP(mCarryBitBlockPtr, storeIndex));
    222222    return iBuilder->CreateBitCast(iBuilder->CreateOr(block1_shl, block0_shr), mBitBlockType);
    223223}
     
    494494        Value * const packPtr = iBuilder->CreateGEP(mCarryPackBasePtr, iBuilder->getInt64(packIndex));
    495495        mCarryPackPtr[packIndex] = packPtr;
    496         mCarryInPack[packIndex] = iBuilder->CreateAlignedLoad(packPtr, mBitBlockWidth / 8);
     496        mCarryInPack[packIndex] = iBuilder->CreateBlockAlignedLoad(packPtr);
    497497    }
    498498    return mCarryInPack[packIndex];
     
    505505    assert (mCarryOutPack[packIndex]);
    506506    assert (mCarryPackPtr[packIndex]);
    507     iBuilder->CreateAlignedStore(mCarryOutPack[packIndex], mCarryPackPtr[packIndex], mBitBlockWidth / 8);
     507    iBuilder->CreateBlockAlignedStore(mCarryOutPack[packIndex], mCarryPackPtr[packIndex]);
    508508}
    509509
  • icGREP/icgrep-devel/icgrep/pablo/pablo_compiler.cpp

    r4959 r4968  
    116116        }
    117117    }
    118 
    119     #ifndef NDEBUG
    120     verifyModule(*mMod, &errs());
    121     #endif
    122 
    123118    return mFunction;
    124119}
     
    378373//        Value * outputPtr = iBuilder->CreateGEP(outputStruct, std::vector<Value *>({ iBuilder->getInt32(0), iBuilder->getInt32(0) }));
    379374
    380 //        expr = iBuilder->CreateAlignedLoad(outputPtr, iBuilder->getBitBlockWidth() / 8, false);
     375//        expr = iBuilder->CreateBlockAlignedLoad(outputPtr);
    381376    } else if (const And * pablo_and = dyn_cast<And>(stmt)) {
    382377        expr = iBuilder->simd_and(compileExpression(pablo_and->getOperand(0)), compileExpression(pablo_and->getOperand(1)));
Note: See TracChangeset for help on using the changeset viewer.