Changeset 4376 for icGREP


Ignore:
Timestamp:
Dec 30, 2014, 12:11:01 PM (5 years ago)
Author:
nmedfort
Message:

Bug fix for if block; wasn't placing the advance summaries in the correct block.

File:
1 edited

Legend:

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

    r4371 r4376  
    667667        // Entry processing is complete, now handle the body of the if.
    668668       
    669         IRBuilder<> bIfBody(ifBodyBlock);
    670669        mBasicBlock = ifBodyBlock;
    671670       
    672671        compileStatements(ifStatement->getBody());
    673        
     672
     673        // If we compiled an If or a While statement, we won't be in the same basic block as before.
     674        // Create the branch from the current basic block to the end block.
     675        IRBuilder<> bIfBody(mBasicBlock);
    674676        // After the recursive compile, now insert the code to compute the summary
    675677        // carry over variable.
     
    693695            genAdvanceOutStore(carry_summary, mAdvanceQueueIdx++); //baseAdvanceQueueIdx + ifAdvanceCount - 1);
    694696        }
    695         // If we compiled an If or a While statement, we won't be in the same basic block as before.
    696         // Create the branch from the current basic block to the end block.
    697         IRBuilder<> bIfBodyEndBlock(mBasicBlock);
    698         bIfBodyEndBlock.CreateBr(ifEndBlock);
     697        bIfBody.CreateBr(ifEndBlock);
    699698        //End Block
    700699        IRBuilder<> bEnd(ifEndBlock);
Note: See TracChangeset for help on using the changeset viewer.