Ignore:
Timestamp:
Jan 5, 2015, 8:26:26 PM (4 years ago)
Author:
cameron
Message:

Optimized system for carry/advance summary variables

File:
1 edited

Legend:

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

    r4382 r4401  
    121121    mCarryQueueVector.resize(mCarryQueueSize);
    122122    mAdvanceQueueVector.resize(mAdvanceQueueSize);
     123    mCarryQueueSummaryIdx.resize(mCarryQueueSize);
     124    mAdvanceQueueSummaryIdx.resize(mAdvanceQueueSize);
    123125    std::string errMessage;
    124126    EngineBuilder builder(mMod);
     
    587589            for (int c = baseCarryQueueIdx; c < baseCarryQueueIdx + ifCarryCount; c++)
    588590            {
    589                 Value* carryq_value = genCarryInLoad(c);
    590                 carry_summary = bIfBody.CreateOr(carry_summary, carryq_value);
     591                int s = mCarryQueueSummaryIdx[c];
     592                if (s == -1) {
     593                    Value* carryq_value = mCarryQueueVector[c];
     594                    carry_summary = bIfBody.CreateOr(carry_summary, carryq_value);
     595                    mCarryQueueSummaryIdx[c] = baseCarryQueueIdx + ifCarryCount;
     596                }
     597
    591598            }
    592599            // Note that the limit in the following uses -1, because
     
    594601            for (int c = baseAdvanceQueueIdx; c < baseAdvanceQueueIdx + ifAdvanceCount - 1; c++)
    595602            {
    596                 Value* advance_q_value = genAdvanceInLoad(c);
    597                 carry_summary = bIfBody.CreateOr(advance_q_value, carry_summary);
     603                int s = mAdvanceQueueSummaryIdx[c];
     604                if (s == -1 ) {
     605                    Value* advance_q_value = mAdvanceQueueVector[c];
     606                    carry_summary = bIfBody.CreateOr(advance_q_value, carry_summary);
     607                    mAdvanceQueueSummaryIdx[c] = baseAdvanceQueueIdx + ifAdvanceCount - 1;
     608                }
    598609            }
    599610            genAdvanceOutStore(carry_summary, mAdvanceQueueIdx++); //baseAdvanceQueueIdx + ifAdvanceCount - 1);
     
    940951        b.CreateAlignedStore(carryOut, b.CreateGEP(mCarryQueuePtr, b.getInt64(index)), BLOCK_SIZE/8, false);
    941952    }
     953    mCarryQueueSummaryIdx[index] = -1;
    942954    mCarryQueueVector[index] = carryOut;
    943955}
     
    959971        b.CreateAlignedStore(advanceOut, b.CreateGEP(mAdvanceQueuePtr, b.getInt64(index)), BLOCK_SIZE/8, false);
    960972    }
     973    mAdvanceQueueSummaryIdx[index] = -1;
    961974    mAdvanceQueueVector[index] = advanceOut;
    962975}
Note: See TracChangeset for help on using the changeset viewer.