Changeset 4403 for icGREP/icgrep-devel


Ignore:
Timestamp:
Jan 6, 2015, 1:25:33 PM (5 years ago)
Author:
cameron
Message:

Fix for access to carry/advance summary variables

File:
1 edited

Legend:

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

    r4401 r4403  
    593593                    Value* carryq_value = mCarryQueueVector[c];
    594594                    carry_summary = bIfBody.CreateOr(carry_summary, carryq_value);
    595                     mCarryQueueSummaryIdx[c] = baseCarryQueueIdx + ifCarryCount;
     595                    mCarryQueueSummaryIdx[c] = mAdvanceQueueIdx;
    596596                }
     597               
    597598
    598599            }
     
    605606                    Value* advance_q_value = mAdvanceQueueVector[c];
    606607                    carry_summary = bIfBody.CreateOr(advance_q_value, carry_summary);
    607                     mAdvanceQueueSummaryIdx[c] = baseAdvanceQueueIdx + ifAdvanceCount - 1;
     608                    mAdvanceQueueSummaryIdx[c] = mAdvanceQueueIdx;
    608609                }
    609610            }
     
    621622            mMarkerMap[a->getName()] = phi;
    622623        }
     624        // Create the phi Node for the summary variable.
     625        if (ifAdvanceCount >= 1) {
     626          // final AdvanceQ entry is summary variable.
     627          PHINode * summary_phi = bEnd.CreatePHI(mBitBlockType, 2, "summary");
     628          summary_phi->addIncoming(mZeroInitializer, ifEntryBlock);
     629          summary_phi->addIncoming(mAdvanceQueueVector[mAdvanceQueueIdx-1], mBasicBlock);
     630          mAdvanceQueueVector[mAdvanceQueueIdx-1] = summary_phi;
     631        }
     632        else if (ifCarryCount == 1) {
     633          PHINode * summary_phi = bEnd.CreatePHI(mBitBlockType, 2, "summary");
     634          summary_phi->addIncoming(mZeroInitializer, ifEntryBlock);
     635          summary_phi->addIncoming(mCarryQueueVector[baseCarryQueueIdx], mBasicBlock);
     636          mCarryQueueVector[baseCarryQueueIdx] = summary_phi;
     637        }
     638       
    623639        // Set the basic block to the new end block
    624640        mBasicBlock = ifEndBlock;
Note: See TracChangeset for help on using the changeset viewer.