Ignore:
Timestamp:
Oct 8, 2016, 7:33:08 PM (3 years ago)
Author:
cameron
Message:

Linear buffers; stdout_kernel; cache-aligned alloca, restructured u8u16, clean-ups

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/IDISA/idisa_builder.h

    r5140 r5185  
    2222public:
    2323
    24     IDISA_Builder(Module * m, Type * bitBlockType)
     24    IDISA_Builder(Module * m, Type * bitBlockType, unsigned CacheAlignment=64)
    2525    : IRBuilder<>(m->getContext())
    2626    , mMod(m)
     27    , mCacheLineAlignment(CacheAlignment)
    2728    , mBitBlockType(bitBlockType)
    2829    , mBitBlockWidth(bitBlockType->isIntegerTy() ? cast<IntegerType>(bitBlockType)->getIntegerBitWidth() : cast<VectorType>(bitBlockType)->getBitWidth())
     
    142143    inline llvm::Type * getSizeTy() {return Triple(llvm::sys::getProcessTriple()).isArch32Bit() ? getInt32Ty() : getInt64Ty();}
    143144   
     145    inline llvm::AllocaInst * CreateCacheAlignedAlloca(llvm::Type * Ty, llvm::Value * ArraySize = nullptr) {
     146        llvm::AllocaInst * instr = CreateAlloca(Ty, ArraySize);
     147        instr->setAlignment(mCacheLineAlignment);
     148        return instr;
     149    }
     150   
     151   
    144152protected:
    145153    Module * mMod;
     154    unsigned mCacheLineAlignment;
    146155    Type * mBitBlockType;
    147156    unsigned mBitBlockWidth;
     
    179188   
    180189
     190   
    181191}
    182192#endif // IDISA_BUILDER_H
Note: See TracChangeset for help on using the changeset viewer.