Changeset 4548 for icGREP/icgrep-devel


Ignore:
Timestamp:
May 9, 2015, 11:15:23 AM (4 years ago)
Author:
cameron
Message:

mBlockNo; include block number in traces.

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

Legend:

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

    r4547 r4548  
    7070, mBasisBitsInputPtr(nullptr)
    7171, mCarryDataPtr(nullptr)
     72, mBlockNo(nullptr)
    7273, mWhileDepth(0)
    7374, mIfDepth(0)
     
    144145    mMaxWhileDepth = 0;
    145146    mBasicBlock = BasicBlock::Create(mMod->getContext(), "parabix_entry", mFunction,0);
     147    IRBuilder<> b(mBasicBlock);
    146148
    147149    //The basis bits structure
    148150    for (unsigned i = 0; i != mBasisBits.size(); ++i) {
    149         IRBuilder<> b(mBasicBlock);
    150151        Value* indices[] = {b.getInt64(0), b.getInt32(i)};
    151152        Value * gep = b.CreateGEP(mBasisBitsAddr, indices);
     
    153154        mMarkerMap.insert(std::make_pair(mBasisBits[i], basisBit));
    154155    }
    155 
     156   
     157    // The block number is a 64-bit integer at the end of the carry data area.
     158    Value * blockNoPtr = b.CreateBitCast(b.CreateGEP(mCarryDataPtr, b.getInt64(totalCarryDataSize)), Type::getInt64PtrTy(b.getContext()));
     159    mBlockNo = b.CreateLoad(blockNoPtr);
    156160    //Generate the IR instructions for the function.
    157161    compileBlock(pb);
    158 
     162    {   IRBuilder<> b(mBasicBlock);  // may be in new basic block, set builder
     163        b.CreateStore(b.CreateAdd(mBlockNo, b.getInt64(1)), blockNoPtr);
     164    }
     165
     166    if (DumpTrace || TraceNext) {
     167        genPrintRegister("blockNo", genCarryDataLoad(totalCarryDataSize));
     168    }
    159169    if (LLVM_UNLIKELY(mWhileDepth != 0)) {
    160170        throw std::runtime_error("Non-zero nesting depth error (" + std::to_string(mWhileDepth) + ")");
     
    10131023    IRBuilder<> b(mBasicBlock);
    10141024    int advEntries = (shift_amount - 1) / BLOCK_SIZE + 1;
     1025    //int advCeil = log2ceil(advEntries);
     1026    //Value * indexMask = b.getInt64(advCeil - 1);
    10151027    int block_shift = shift_amount % BLOCK_SIZE;
    10161028    const auto advanceIndex = blk->getCarryIndexBase() + blk->getLocalCarryCount() + localIndex;
     1029    //Value * blockIndex = b.CreateAnd(mBlockNo, indexMask);
     1030    //Value * idx2 = b.CreateAnd(b.CreateAdd(mBlockNo - b.getInt64(advEntries - 1)), indexMask);
    10171031    const auto storeIdx = advanceIndex;
    10181032    const auto loadIdx = advanceIndex + advEntries - 1;
  • icGREP/icgrep-devel/icgrep/pablo/pablo_compiler.h

    r4547 r4548  
    146146
    147147    Value*                              mCarryDataPtr;
     148    Value*                              mBlockNo;
    148149    unsigned                            mWhileDepth;
    149150    unsigned                            mIfDepth;
Note: See TracChangeset for help on using the changeset viewer.