Changeset 4401


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

Optimized system for carry/advance summary variables

Location:
icGREP/icgrep-devel/icgrep
Files:
3 edited

Legend:

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

    r4353 r4401  
    5555   
    5656    cl::opt<bool> CountOnly("c", cl::desc("Count and display the matching lines per file only."), cl::cat(bGrepOutputOptions));
    57     cl::alias CountOnlyLong("-count", cl::desc("Alias for -c"), cl::aliasopt(CountOnly));
     57    cl::alias CountOnlyLong("count", cl::desc("Alias for -c"), cl::aliasopt(CountOnly));
    5858   
    5959    cl::opt<bool> ShowFileNames("H", cl::desc("Show the file name with each matching line."), cl::cat(bGrepOutputOptions));
    60     cl::alias ShowFileNamesLong("-with-filename", cl::desc("Alias for -H"), cl::aliasopt(ShowFileNames));
     60    cl::alias ShowFileNamesLong("with-filename", cl::desc("Alias for -H"), cl::aliasopt(ShowFileNames));
    6161   
    6262    cl::opt<bool> ShowLineNumbers("n", cl::desc("Show the line number with each matching line."), cl::cat(bGrepOutputOptions));
    63     cl::alias ShowLineNumbersLong("-line-number", cl::desc("Alias for -n"), cl::aliasopt(ShowLineNumbers));
     63    cl::alias ShowLineNumbersLong("line-number", cl::desc("Alias for -n"), cl::aliasopt(ShowLineNumbers));
    6464   
    6565    cl::list<std::string> regexVector("e", cl::desc("Regular expression"), cl::ZeroOrMore, cl::cat(aRegexSourceOptions));
  • 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}
  • icGREP/icgrep-devel/icgrep/pablo/pablo_compiler.h

    r4382 r4401  
    100100    StringToValueMap                    mMarkerMap;
    101101    CarryQueueVector                    mCarryQueueVector;
     102    std::vector<int>                    mCarryQueueSummaryIdx;
    102103    CarryQueueVector                    mAdvanceQueueVector;
     104    std::vector<int>                    mAdvanceQueueSummaryIdx;
    103105
    104106    const std::vector<Var *> &          mBasisBits;
Note: See TracChangeset for help on using the changeset viewer.