Ignore:
Timestamp:
Oct 9, 2015, 10:24:51 AM (4 years ago)
Author:
cameron
Message:

Parameterize carry_manager to inherit BitBlockWidth? from idisa builder

File:
1 edited

Legend:

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

    r4821 r4827  
    129129        Value* indices[] = {mBuilder->getInt64(0), mBuilder->getInt32(i)};
    130130        Value * gep = mBuilder->CreateGEP(mInputAddressPtr, indices);
    131         LoadInst * basisBit = mBuilder->CreateAlignedLoad(gep, BLOCK_SIZE/8, false, function->getParameter(i)->getName()->to_string());
     131        LoadInst * basisBit = mBuilder->CreateAlignedLoad(gep, iBuilder.getBitBlockWidth()/8, false, function->getParameter(i)->getName()->to_string());
    132132        mMarkerMap[function->getParameter(i)] = basisBit;
    133133        if (DumpTrace) {
     
    149149
    150150    if (DumpTrace) {
    151         genPrintRegister("mBlockNo", mBuilder->CreateAlignedLoad(mBuilder->CreateBitCast(mCarryManager->getBlockNoPtr(), PointerType::get(mBitBlockType, 0)), BLOCK_SIZE/8, false));
     151        genPrintRegister("mBlockNo", mBuilder->CreateAlignedLoad(mBuilder->CreateBitCast(mCarryManager->getBlockNoPtr(), PointerType::get(mBitBlockType, 0)), iBuilder.getBitBlockWidth()/8, false));
    152152    }
    153153   
     
    166166    mMod = nullptr; // don't delete this. It's either owned by the ExecutionEngine or the calling function.
    167167
    168     //Return the required size of the carry data area to the process_block function.
    169168    return mFunction;
    170169}
     
    253252    }
    254253   
    255     void PabloCompiler::compileIf(const If * ifStatement) {       
     254void PabloCompiler::compileIf(const If * ifStatement) {       
    256255    //
    257256    //  The If-ElseZero stmt:
     
    436435        mBuilder->CreateCall2(externalFunction, mInputAddressPtr, outputStruct);
    437436        Value * outputPtr = mBuilder->CreateGEP(outputStruct, std::vector<Value *>({ mBuilder->getInt32(0), mBuilder->getInt32(0) }));
    438         expr = mBuilder->CreateAlignedLoad(outputPtr, BLOCK_SIZE / 8, false);
     437        expr = mBuilder->CreateAlignedLoad(outputPtr, iBuilder.getBitBlockWidth() / 8, false);
    439438    }
    440439    else if (const And * pablo_and = dyn_cast<And>(stmt)) {
     
    536535    }
    537536    if (LLVM_UNLIKELY(marker->getType()->isPointerTy())) {
    538         marker = mBuilder->CreateAlignedLoad(marker, BLOCK_SIZE/8, false);
     537        marker = mBuilder->CreateAlignedLoad(marker, iBuilder.getBitBlockWidth()/8, false);
    539538    }
    540539    Value* indices[] = {mBuilder->getInt64(0), mBuilder->getInt32(index)};
    541540    Value* gep = mBuilder->CreateGEP(mOutputAddressPtr, indices);
    542     mBuilder->CreateAlignedStore(marker, gep, BLOCK_SIZE/8, false);
    543 }
    544 
    545 }
     541    mBuilder->CreateAlignedStore(marker, gep, iBuilder.getBitBlockWidth()/8, false);
     542}
     543
     544}
Note: See TracChangeset for help on using the changeset viewer.