Ignore:
Timestamp:
Sep 1, 2014, 1:11:04 AM (5 years ago)
Author:
linmengl
Message:

auto detect LLVM version in CMakeList.txt; add #ifdef blocks

File:
1 edited

Legend:

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

    r4117 r4118  
    551551    // to call->  b.CreateCall(mFunc_print_register, unicode_category);
    552552
     553#ifdef USE_UADD_OVERFLOW
    553554    // Type Definitions for llvm.uadd.with.overflow.i128
    554555    std::vector<Type*>StructTy_0_fields;
     
    588589    }
    589590    mFunc_llvm_uadd_with_overflow_i128->setAttributes(mFunc_llvm_uadd_with_overflow_i128_PAL);
     591#endif
    590592
    591593    //Starts on process_block
     
    11831185
    11841186#ifdef USE_UADD_OVERFLOW
    1185     //new code chunk, use llvm.uadd.with.overflow.i128
     1187    //use llvm.uadd.with.overflow.i128
    11861188    CastInst* int128_e1 = new BitCastInst(e1, IntegerType::get(mMod->getContext(), 128), "e1_128", mBasicBlock);
    11871189    CastInst* int128_e2 = new BitCastInst(e2, IntegerType::get(mMod->getContext(), 128), "e2_128", mBasicBlock);
     
    12031205
    12041206    Value* void_1 = genCarryOutStore(carry_out, mptr_carry_q, this_carry_idx);
    1205 
    12061207    return ret_sum;
    1207     //new code chunk ends
    1208 #endif
    1209 #ifndef USE_UADD_OVERFLOW
    1210     //Old code chunk, calculate carry through logical ops
     1208#else
     1209    //calculate carry through logical ops
    12111210    Value* carrygen = b.CreateAnd(e1, e2, "carrygen");
    12121211    Value* carryprop = b.CreateOr(e1, e2, "carryprop");
     
    12211220
    12221221    return sum;
    1223     //Old code chunk ends
    12241222#endif
    12251223}
Note: See TracChangeset for help on using the changeset viewer.