Ignore:
Timestamp:
Jan 6, 2019, 4:33:48 PM (5 months ago)
Author:
nmedfort
Message:

More work on optimizing for stateless kernels

File:
1 edited

Legend:

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

    r6184 r6275  
    197197    mCarryInfo = &mCarryMetadata[0];
    198198    assert (!mCarryInfo->hasSummary());
    199 
    200     mCurrentFrame = b->getScalarFieldPtr("carries");
     199    if (LLVM_LIKELY(mKernel->isStateful())) {
     200        mCurrentFrame = b->getScalarFieldPtr("carries");
     201    } else {
     202        mCurrentFrame = nullptr;
     203    }
    201204    mCurrentFrameIndex = 0;
    202205    mCarryScopes = 0;
     
    211214    mCarrySummaryStack.push_back(Constant::getNullValue(carryTy));
    212215
    213     if (mHasLoop) {       
     216    if (mHasLoop) {
    214217        mLoopSelector = b->getScalarField("selector");
    215218        mNextLoopSelector = b->CreateXor(mLoopSelector, ConstantInt::get(mLoopSelector->getType(), 1));
     
    230233        b->setScalarField("CarryBlockIndex", idx);
    231234    }
    232     assert (mCarryFrameStack.empty());   
     235    assert (mCarryFrameStack.empty());
    233236    assert ("base summary value was deleted!" && mCarrySummaryStack.size() == 1);
    234237    assert ("base summary value was overwritten with non-zero value!" && isa<Constant>(mCarrySummaryStack[0]) && cast<Constant>(mCarrySummaryStack[0])->isNullValue());
     
    748751                if (LLVM_LIKELY(i == summarySize)) {
    749752                    const auto n = bitBlockTy->getVectorNumElements();
    750                     Constant * mask[n];                                       
     753                    Constant * mask[n];
    751754                    const auto m = udiv(summaryBlocks, laneWidth);
    752755                    if (m) {
     
    921924 ** ------------------------------------------------------------------------------------------------------------- */
    922925inline void CarryManager::addToCarryOutSummary(const std::unique_ptr<kernel::KernelBuilder> & b, Value * const value) {
    923     assert ("cannot add null summary value!" && value);   
     926    assert ("cannot add null summary value!" && value);
    924927    assert ("summary stack is empty!" && !mCarrySummaryStack.empty());
    925928    assert (mCarryInfo->hasSummary());
Note: See TracChangeset for help on using the changeset viewer.