Ignore:
Timestamp:
Jan 5, 2017, 3:54:40 PM (3 years ago)
Author:
nmedfort
Message:

Code clean up to enforce proper calling order of KernelBuilder? methods

File:
1 edited

Legend:

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

    r5240 r5246  
    238238
    239239    Value * blockPos = iBuilder->CreateLoad(kBuilder->getBlockNo());
    240     blockPos = iBuilder->CreateMul(blockPos, ConstantInt::get(iBuilder->getSizeTy(), iBuilder->getBitBlockWidth()));
     240    blockPos = iBuilder->CreateMul(blockPos, iBuilder->getSize(iBuilder->getBitBlockWidth()));
    241241
    242242    iBuilder->CreateBr(groupCond);
     
    280280    PHINode * startIV = iBuilder->CreatePHI(iBuilder->getSizeTy(), 2);
    281281    startIV->addIncoming(iBuilder->getSize(0), groupBody);
    282     Value * startOuterTest = iBuilder->CreateICmpNE(startIV, ConstantInt::get(iBuilder->getSizeTy(), fieldCount));
     282    Value * startOuterTest = iBuilder->CreateICmpNE(startIV, iBuilder->getSize(fieldCount));
    283283    iBuilder->CreateCondBr(startOuterTest, startOuterBody, endOuterCond);
    284284
     
    287287    Value * startField = iBuilder->CreateExtractElement(startStream, startIV);
    288288    startIV->addIncoming(iBuilder->CreateAdd(startIV, iBuilder->getSize(1)), startInnerCond);
    289     startBlockOffset->addIncoming(iBuilder->CreateAdd(startBlockOffset, ConstantInt::get(iBuilder->getSizeTy(), scanWordBitWidth)), startInnerCond);
     289    startBlockOffset->addIncoming(iBuilder->CreateAdd(startBlockOffset, iBuilder->getSize(scanWordBitWidth)), startInnerCond);
    290290    iBuilder->CreateBr(startInnerCond);
    291291
     
    319319    PHINode * endIV = iBuilder->CreatePHI(iBuilder->getSizeTy(), 2);
    320320    endIV->addIncoming(iBuilder->getSize(0), startOuterCond);
    321     Value * endOuterTest = iBuilder->CreateICmpNE(endIV, ConstantInt::get(iBuilder->getSizeTy(), fieldCount));
     321    Value * endOuterTest = iBuilder->CreateICmpNE(endIV, iBuilder->getSize(fieldCount));
    322322    iBuilder->CreateCondBr(endOuterTest, endOuterBody, nextGroup);
    323323
     
    326326    Value * endField = iBuilder->CreateExtractElement(endStream, endIV);
    327327    endIV->addIncoming(iBuilder->CreateAdd(endIV, iBuilder->getSize(1)), endInnerCond);
    328     endBlockOffset->addIncoming(iBuilder->CreateAdd(endBlockOffset, ConstantInt::get(iBuilder->getSizeTy(), scanWordBitWidth)), endInnerCond);
     328    endBlockOffset->addIncoming(iBuilder->CreateAdd(endBlockOffset, iBuilder->getSize(scanWordBitWidth)), endInnerCond);
    329329    iBuilder->CreateBr(endInnerCond);
    330330
     
    681681    const unsigned leadingBlocks = (mLongestLookahead + iBuilder->getBitBlockWidth() - 1) / iBuilder->getBitBlockWidth();
    682682
    683     Value * const requiredBytes = ConstantInt::get(iBuilder->getSizeTy(), mBlockSize * leadingBlocks);
    684     Value * const blockSize = ConstantInt::get(iBuilder->getSizeTy(), mBlockSize);
     683    Value * const requiredBytes = iBuilder->getSize(mBlockSize * leadingBlocks);
     684    Value * const blockSize = iBuilder->getSize(mBlockSize);
    685685
    686686    // First compute any necessary leading blocks to allow the sorting kernel access to the "future" data produced by
Note: See TracChangeset for help on using the changeset viewer.