Ignore:
Timestamp:
May 20, 2015, 12:27:09 PM (4 years ago)
Author:
cameron
Message:

Abstract conditions for if-summary computation

File:
1 edited

Legend:

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

    r4567 r4568  
    442442   
    443443        const unsigned baseCarryDataIdx = cd.getBlockCarryDataIndex();
    444         const unsigned carryDataSize = cd.getTotalCarryDataSize();
    445444        const unsigned carrySummaryIndex = cd.summaryCarryDataIndex();
    446445       
    447446        Value* if_test_value = compileExpression(ifStatement->getCondition());
    448         if (carryDataSize > 0) {
     447        if (cd.blockHasCarries()) {
    449448            // load the summary variable
    450449            Value* last_if_pending_data = genCarryDataLoad(carrySummaryIndex);
     
    463462        // carry over variable.
    464463       
    465         if (carryDataSize > 1) {
     464        if (cd.explicitSummaryRequired()) {
    466465            // If there was only one carry entry, then it also serves as the summary variable.
    467466            // Otherwise, we need to combine entries to compute the summary.
     
    494493            mMarkerMap[assign] = phi;
    495494        }
    496         // Create the phi Node for the summary variable.
    497         if (carryDataSize > 0) {
     495        // Create the phi Node for the summary variable, if needed.
     496        if (cd.summaryNeededInParentBlock()) {
    498497            PHINode * summary_phi = bEnd.CreatePHI(mBitBlockType, 2, "summary");
    499498            summary_phi->addIncoming(mZeroInitializer, ifEntryBlock);
Note: See TracChangeset for help on using the changeset viewer.