Ignore:
Timestamp:
Jan 13, 2018, 11:57:43 AM (15 months ago)
Author:
nmedfort
Message:

Pablo support for byte comparisions; LineFeed? kernel processes byte streams directly. Some clean up of PabloBuilder? functionality.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/IR_Gen/CBuilder.cpp

    r5812 r5828  
    678678}
    679679
    680 IntegerType * CBuilder::getIntAddrTy() const {
     680IntegerType * LLVM_READNONE CBuilder::getIntAddrTy() const {
    681681    return TypeBuilder<intptr_t, false>::get(getContext());
    682682}
    683683
    684 PointerType * CBuilder::getVoidPtrTy(const unsigned AddressSpace) const {
     684PointerType * LLVM_READNONE CBuilder::getVoidPtrTy(const unsigned AddressSpace) const {
    685685    return PointerType::get(Type::getVoidTy(getContext()), AddressSpace);
    686686}
     
    701701}
    702702
    703 PointerType * CBuilder::getFILEptrTy() {
     703PointerType * LLVM_READNONE CBuilder::getFILEptrTy() {
    704704    if (mFILEtype == nullptr) {
    705705        mFILEtype = StructType::create(getContext(), "struct._IO_FILE");
     
    10841084    } else { // if assertions are not enabled, make it a compiler assumption.
    10851085
    1086         // INVESTIGATE: while interesting, this does not seem to produce faster code and only provides a trivial reduction
    1087         // of compiled code size in LLVM 3.8 but nearly doubles compilation time. This may have been improved with later
    1088         // versions of LLVM but it's likely that assumptions ought to be hand placed once they're prove to improve performance.
     1086        // INVESTIGATE: while interesting, this does not seem to produce faster code and only provides a trivial
     1087        // reduction of compiled code size in LLVM 3.8 but nearly doubles compilation time. This may have been
     1088        // improved with later versions of LLVM but it's likely that assumptions ought to be hand placed once
     1089        // they're proven to improve performance.
    10891090
    10901091        // IRBuilder<>::CreateAssumption(assertion);
     
    11041105}
    11051106
    1106 BasicBlock * CBuilder::CreateBasicBlock(std::string && name) {
    1107     return BasicBlock::Create(getContext(), name, GetInsertBlock()->getParent());
     1107BasicBlock * CBuilder::CreateBasicBlock(const StringRef name, BasicBlock * insertBefore) {
     1108    return BasicBlock::Create(getContext(), name, GetInsertBlock()->getParent(), insertBefore);
    11081109}
    11091110
     
    11251126}
    11261127
    1127 Value * CBuilder::CreateCountForwardZeroes(Value * value, const bool isZeroUndefined) {
    1128     if (LLVM_UNLIKELY(isZeroUndefined && codegen::DebugOptionIsSet(codegen::EnableAsserts))) {
     1128Value * CBuilder::CreateCountForwardZeroes(Value * value, const bool guaranteedNonZero) {
     1129    if (LLVM_UNLIKELY(guaranteedNonZero && codegen::DebugOptionIsSet(codegen::EnableAsserts))) {
    11291130        CreateAssert(value, "CreateCountForwardZeroes: value cannot be zero!");
    11301131    }
    1131     Value * cttzFunc = Intrinsic::getDeclaration(getModule(), Intrinsic::cttz, value->getType());
    1132     return CreateCall(cttzFunc, {value, getInt1(isZeroUndefined)});
    1133 }
    1134 
    1135 Value * CBuilder::CreateCountReverseZeroes(Value * value, const bool isZeroUndefined) {
    1136     if (LLVM_UNLIKELY(isZeroUndefined && codegen::DebugOptionIsSet(codegen::EnableAsserts))) {
     1132    Value * cttzFunc = Intrinsic::getDeclaration(getModule(), Intrinsic::cttz, value->getType());   
     1133    return CreateCall(cttzFunc, {value, getInt1(guaranteedNonZero)});
     1134}
     1135
     1136Value * CBuilder::CreateCountReverseZeroes(Value * value, const bool guaranteedNonZero) {
     1137    if (LLVM_UNLIKELY(guaranteedNonZero && codegen::DebugOptionIsSet(codegen::EnableAsserts))) {
    11371138        CreateAssert(value, "CreateCountReverseZeroes: value cannot be zero!");
    11381139    }
    11391140    Value * ctlzFunc = Intrinsic::getDeclaration(getModule(), Intrinsic::ctlz, value->getType());
    1140     return CreateCall(ctlzFunc, {value, getInt1(isZeroUndefined)});
     1141    return CreateCall(ctlzFunc, {value, getInt1(guaranteedNonZero)});
    11411142}
    11421143
Note: See TracChangeset for help on using the changeset viewer.