Changeset 4002


Ignore:
Timestamp:
Aug 15, 2014, 7:15:54 AM (5 years ago)
Author:
cameron
Message:

Sel: remove duplicate if calc; minor notes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/llvm_gen.cpp

    r3999 r4002  
    398398    mCarryQueueSize = LLVM_Generator_Helper::CarryCount_PabloStatements(subexpression_cg_state.stmtsl);
    399399    mCarryQueueSize += LLVM_Generator_Helper::CarryCount_PabloStatements(cg_state.stmtsl);
     400    /* The following may be needed if carry-generating operations are ever inserted
     401       by the character class compiler.
     402    mCarryQueueSize += LLVM_Generator_Helper::CarryCount_PabloStatements(cc_cgo_stmtsl);
     403    */
    400404
    401405    mBasicBlock = BasicBlock::Create(mMod->getContext(), "parabix_entry", mFunc_process_block,0);
     
    429433
    430434    //Un-comment this line in order to display the IR that has been generated by this module.
    431     //mMod->dump();
     435#ifdef DUMP_GENERATED_IR
     436    mMod->dump();
     437#endif
    432438
    433439    //Use the pass manager to run optimizations on the function.
     
    449455    fpm.run(*mFunc_process_block);
    450456
    451     //mMod->dump();
    452 
     457#ifdef DUMP_OPTIMIZED_IR
     458    mMod->dump();
     459#endif
    453460    mExecutionEngine->finalizeObject();
    454461
     
    460467    return retVal;
    461468}
     469
     470#define bitBlockExprType m64x2Vect
    462471
    463472void LLVM_Generator::DefineTypes()
     
    964973    {
    965974        IRBuilder<>b(mBasicBlock);
    966 
    967         Value* and_if_true_result = b.CreateAnd(Generate_PabloE(pablo_sel->getIf_expr()), Generate_PabloE(pablo_sel->getT_expr()));
    968         Constant* const_packed_elems [] = {b.getInt64(-1), b.getInt64(-1)};
    969         Constant* const_packed = ConstantVector::get(const_packed_elems);
    970         Value* not_if_result = b.CreateXor(Generate_PabloE(pablo_sel->getIf_expr()), const_packed);
    971         Value* and_if_false_result = b.CreateAnd(not_if_result, Generate_PabloE(pablo_sel->getF_expr()));
     975        Value* ifMask = Generate_PabloE(pablo_sel->getIf_expr());
     976        Value* and_if_true_result = b.CreateAnd(ifMask, Generate_PabloE(pablo_sel->getT_expr()));
     977        Value* and_if_false_result = b.CreateAnd(genNot(ifMask), Generate_PabloE(pablo_sel->getF_expr()));
    972978        Value* or_result = b.CreateOr(and_if_true_result, and_if_false_result);
    973979
     
    11631169}
    11641170
    1165 #define bitBlockExprType m64x2Vect
     1171
    11661172
    11671173Value* LLVM_Generator::genShiftRight127(Value* e, const Twine &namehint) {
Note: See TracChangeset for help on using the changeset viewer.