Ignore:
Timestamp:
Jan 14, 2017, 3:49:56 PM (2 years ago)
Author:
nmedfort
Message:

Changes working towards simplifying accessing stream elements + some modifications to simplify include / forward declarations within the CodeGen? library.

Location:
icGREP/icgrep-devel/icgrep/IR_Gen
Files:
14 edited

Legend:

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

    r5245 r5260  
    77#include "CBuilder.h"
    88#include <llvm/IR/IRBuilder.h>
     9#include <llvm/IR/Module.h>
    910#include <llvm/IR/Constants.h>
    1011#include <llvm/IR/Intrinsics.h>
     
    1314#include <llvm/IR/TypeBuilder.h>
    1415
    15 
     16using namespace llvm;
    1617
    1718// ssize_t write(int fildes, const void *buf, size_t nbyte);
     
    290291    return CreateCall(pthreadJoinFunc, {thread, value_ptr});
    291292}
     293
     294CBuilder::CBuilder(llvm::Module * m, unsigned archBitWidth, unsigned CacheAlignment)
     295: IRBuilder<>(m->getContext())
     296, mMod(m)
     297, mCacheLineAlignment(CacheAlignment)
     298, mSizeType(getIntNTy(archBitWidth)) {
     299}
  • icGREP/icgrep-devel/icgrep/IR_Gen/CBuilder.h

    r5245 r5260  
    66#define CBUILDER_H
    77
    8 #include <llvm/IR/Module.h>
    9 #include <llvm/IR/Constant.h>
    10 #include <llvm/IR/Type.h>
    11 #include <llvm/IR/Value.h>
     8#include <string>
    129#include <llvm/IR/IRBuilder.h>
    13 #include <llvm/Support/Host.h>
    14 #include <llvm/ADT/Triple.h>
    15 #include <IR_Gen/types/streamtype.h>
    16 #include <boost/container/flat_map.hpp>
     10#include <llvm/IR/Constants.h>
     11namespace llvm { class Function; }
     12namespace llvm { class IntegerType; }
     13namespace llvm { class Module; }
     14namespace llvm { class PointerType; }
     15namespace llvm { class Type; }
     16namespace llvm { class Value; }
    1717
    18 using namespace llvm;
    19 
    20 
    21 class CBuilder : public IRBuilder<> {
     18class CBuilder : public llvm::IRBuilder<> {
    2219   
    2320public:
    2421   
    25     CBuilder(Module * m, unsigned archBitWidth, unsigned CacheAlignment=64)
    26     : IRBuilder<>(m->getContext())
    27     , mMod(m)
    28     , mCacheLineAlignment(CacheAlignment)
    29     , mSizeType(getIntNTy(archBitWidth)) {
    30     }
     22    CBuilder(llvm::Module * m, unsigned archBitWidth, unsigned CacheAlignment=64);
    3123   
    3224    virtual ~CBuilder() {}
    3325
    34     Module * getModule() const {
     26    llvm::Module * getModule() const {
    3527        return mMod;
    3628    }
    3729   
    38     void setModule(Module * m)  {
     30    void setModule(llvm::Module * m)  {
    3931        mMod = m;
    4032    }
    4133   
    42     Function * GetPrintf();
    43     Value * CreateMalloc(Type * type, Value * size);
    44     Value * CreateAlignedMalloc(Type * type, Value * size, const unsigned alignment);
    45     void CreateFree(Value * const ptr);
    46     void CreateAlignedFree(Value * const ptr, const bool ptrMayBeNull = false);
    47     Value * CreateRealloc(Value * ptr, Value * size);
    48     void CreateMemZero(Value * ptr, Value * size, const unsigned alignment = 1);
     34    llvm::Function * GetPrintf();
     35    llvm::Value * CreateMalloc(llvm::Type * type, llvm::Value * size);
     36    llvm::Value * CreateAlignedMalloc(llvm::Type * type, llvm::Value * size, const unsigned alignment);
     37    void CreateFree(llvm::Value * const ptr);
     38    void CreateAlignedFree(llvm::Value * const ptr, const bool ptrMayBeNull = false);
     39    llvm::Value * CreateRealloc(llvm::Value * ptr, llvm::Value * size);
     40    void CreateMemZero(llvm::Value * ptr, llvm::Value * size, const unsigned alignment = 1);
    4941
    5042    inline llvm::AllocaInst * CreateCacheAlignedAlloca(llvm::Type * Ty, llvm::Value * ArraySize = nullptr) {
     
    5749    //
    5850    // ssize_t write(int fildes, const void *buf, size_t nbyte);
    59     Value * CreateWriteCall(Value * fildes, Value * buf, Value * nbyte);
     51    llvm::Value * CreateWriteCall(llvm::Value * fildes, llvm::Value * buf, llvm::Value * nbyte);
    6052   
    6153    // Create calls to Posix thread (pthread.h) functions.
     
    6355    //  int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
    6456    //                    void *(*start_routine)(void*), void *arg);
    65     Value * CreatePThreadCreateCall(Value * thread, Value * attr, Function * start_routine, Value * arg);
     57    llvm::Value * CreatePThreadCreateCall(llvm::Value * thread, llvm::Value * attr, llvm::Function * start_routine, llvm::Value * arg);
    6658    //  void pthread_exit(void *value_ptr);
    67     Value * CreatePThreadExitCall(Value * value_ptr);
     59    llvm::Value * CreatePThreadExitCall(llvm::Value * value_ptr);
    6860    //  int pthread_join(pthread_t thread, void **value_ptr);
    69     Value * CreatePThreadJoinCall(Value * thread, Value * value_ptr);
     61    llvm::Value * CreatePThreadJoinCall(llvm::Value * thread, llvm::Value * value_ptr);
    7062   
    71     void CallPrintInt(const std::string & name, Value * const value);
     63    void CallPrintInt(const std::string & name, llvm::Value * const value);
    7264   
    7365    inline llvm::IntegerType * getSizeTy() const {
     
    7668   
    7769    inline llvm::ConstantInt * getSize(const size_t value) const {
    78         return ConstantInt::get(getSizeTy(), value);
     70        return llvm::ConstantInt::get(getSizeTy(), value);
    7971    }
    8072   
    81     PointerType * getVoidPtrTy() const;
     73    llvm::PointerType * getVoidPtrTy() const;
    8274   
    8375    inline unsigned getCacheAlignment() const {
     
    8577    }
    8678   
    87     virtual llvm::LoadInst* CreateAtomicLoadAcquire(Value * ptr);
    88     virtual llvm::StoreInst *  CreateAtomicStoreRelease(Value * val, Value * ptr);
     79    virtual llvm::LoadInst* CreateAtomicLoadAcquire(llvm::Value * ptr);
     80
     81    virtual llvm::StoreInst *  CreateAtomicStoreRelease(llvm::Value * val, llvm::Value * ptr);
    8982   
    9083protected:
    91     Module *            mMod;
     84    llvm::Module *      mMod;
    9285    unsigned            mCacheLineAlignment;
    93     IntegerType *      mSizeType;
     86    llvm::IntegerType * mSizeType;
    9487};
    9588
  • icGREP/icgrep-devel/icgrep/IR_Gen/idisa_avx_builder.cpp

    r5115 r5260  
    1010#include <llvm/IR/Intrinsics.h>
    1111#include <llvm/IR/Function.h>
    12 #include <iostream>
     12#include <llvm/IR/Module.h>
    1313
    1414namespace IDISA {
  • icGREP/icgrep-devel/icgrep/IR_Gen/idisa_builder.cpp

    r5245 r5260  
    1010#include <llvm/IR/Intrinsics.h>
    1111#include <llvm/IR/Function.h>
     12#include <llvm/IR/Module.h>
    1213#include <llvm/Support/raw_ostream.h>
    1314#include <llvm/IR/TypeBuilder.h>
     15
     16using namespace llvm;
    1417
    1518namespace IDISA {
     
    378381}
    379382
    380 Type * IDISA_Builder::getStreamTy(const unsigned FieldWidth) {
     383StreamType * IDISA_Builder::getStreamTy(const unsigned FieldWidth) {
    381384    const auto f = mStreamTypes.find(FieldWidth);
    382385    if (LLVM_LIKELY(f != mStreamTypes.end())) {
  • icGREP/icgrep-devel/icgrep/IR_Gen/idisa_builder.h

    r5245 r5260  
    77 *  icgrep is a trademark of International Characters.
    88 */
    9 #include <llvm/IR/Module.h>
    10 #include <llvm/IR/Constant.h>
    11 #include <llvm/IR/Type.h>
    12 #include <llvm/IR/Value.h>
    13 #include <llvm/IR/IRBuilder.h>
    14 #include <llvm/Support/Host.h>
    15 #include <llvm/ADT/Triple.h>
    16 #include <IR_Gen/CBuilder.h>
     9#include "CBuilder.h"
     10#include <llvm/IR/DerivedTypes.h>
    1711#include <IR_Gen/types/streamtype.h>
    1812#include <boost/container/flat_map.hpp>
    19 
    20 using namespace llvm;
     13namespace llvm { class Constant; }
     14namespace llvm { class LoadInst; }
     15namespace llvm { class Module; }
     16namespace llvm { class Type; }
     17namespace llvm { class Value; }
    2118
    2219namespace IDISA {
     
    2825public:
    2926
    30     IDISA_Builder(Module * m, unsigned archBitWidth, unsigned bitBlockWidth, unsigned stride, unsigned CacheAlignment=64);
     27    IDISA_Builder(llvm::Module * m, unsigned archBitWidth, unsigned bitBlockWidth, unsigned stride, unsigned CacheAlignment=64);
    3128
    3229    virtual ~IDISA_Builder();
     
    3431    std::string getBitBlockTypeName() const;  // A short string such as v4i64 or i256.
    3532
    36     Value * bitCast(Value * a) {
     33    llvm::Value * bitCast(llvm::Value * a) {
    3734        return (a->getType() == mBitBlockType) ? a : CreateBitCast(a, mBitBlockType);
    3835    }
     
    4643    }
    4744
    48     Constant * allZeroes() const {
     45    llvm::Constant * allZeroes() const {
    4946        return mZeroInitializer;
    5047    }
    5148
    52     Constant * allOnes() const {
     49    llvm::Constant * allOnes() const {
    5350        return mOneInitializer;
    5451    }
    5552   
    5653
    57     LoadInst * CreateBlockAlignedLoad(Value * const ptr);
    58     LoadInst * CreateBlockAlignedLoad(Value * const ptr, Value * const index);
    59     LoadInst * CreateBlockAlignedLoad(Value * const ptr, std::initializer_list<Value *> indices);
     54    llvm::LoadInst * CreateBlockAlignedLoad(llvm::Value * const ptr);
     55    llvm::LoadInst * CreateBlockAlignedLoad(llvm::Value * const ptr, llvm::Value * const index);
     56    llvm::LoadInst * CreateBlockAlignedLoad(llvm::Value * const ptr, std::initializer_list<llvm::Value *> indices);
    6057
    61     void CreateBlockAlignedStore(Value * const value, Value * const ptr);
    62     void CreateBlockAlignedStore(Value * const value, Value * const ptr, Value * const index);
    63     void CreateBlockAlignedStore(Value * const value, Value * const ptr, std::initializer_list<Value *> indices);
     58    void CreateBlockAlignedStore(llvm::Value * const value, llvm::Value * const ptr);
     59    void CreateBlockAlignedStore(llvm::Value * const value, llvm::Value * const ptr, llvm::Value * const index);
     60    void CreateBlockAlignedStore(llvm::Value * const value, llvm::Value * const ptr, std::initializer_list<llvm::Value *> indices);
    6461
    65     VectorType * fwVectorType(unsigned fw);
     62    llvm::VectorType * fwVectorType(unsigned fw);
    6663
    67     Constant * simd_himask(unsigned fw);
    68     Constant * simd_lomask(unsigned fw);
     64    llvm::Constant * simd_himask(unsigned fw);
     65    llvm::Constant * simd_lomask(unsigned fw);
    6966   
    70     virtual Value * simd_fill(unsigned fw, Value * a);
     67    virtual llvm::Value * simd_fill(unsigned fw, llvm::Value * a);
    7168
    72     virtual Value * simd_add(unsigned fw, Value * a, Value * b);
    73     virtual Value * simd_sub(unsigned fw, Value * a, Value * b);
    74     virtual Value * simd_mult(unsigned fw, Value * a, Value * b);
    75     virtual Value * simd_eq(unsigned fw, Value * a, Value * b);
    76     virtual Value * simd_gt(unsigned fw, Value * a, Value * b);
    77     virtual Value * simd_ugt(unsigned fw, Value * a, Value * b);
    78     virtual Value * simd_lt(unsigned fw, Value * a, Value * b);
    79     virtual Value * simd_ult(unsigned fw, Value * a, Value * b);
    80     virtual Value * simd_max(unsigned fw, Value * a, Value * b);
    81     virtual Value * simd_umax(unsigned fw, Value * a, Value * b);
    82     virtual Value * simd_min(unsigned fw, Value * a, Value * b);
    83     virtual Value * simd_umin(unsigned fw, Value * a, Value * b);
    84     virtual Value * simd_if(unsigned fw, Value * cond, Value * a, Value * b);
     69    virtual llvm::Value * simd_add(unsigned fw, llvm::Value * a, llvm::Value * b);
     70    virtual llvm::Value * simd_sub(unsigned fw, llvm::Value * a, llvm::Value * b);
     71    virtual llvm::Value * simd_mult(unsigned fw, llvm::Value * a, llvm::Value * b);
     72    virtual llvm::Value * simd_eq(unsigned fw, llvm::Value * a, llvm::Value * b);
     73    virtual llvm::Value * simd_gt(unsigned fw, llvm::Value * a, llvm::Value * b);
     74    virtual llvm::Value * simd_ugt(unsigned fw, llvm::Value * a, llvm::Value * b);
     75    virtual llvm::Value * simd_lt(unsigned fw, llvm::Value * a, llvm::Value * b);
     76    virtual llvm::Value * simd_ult(unsigned fw, llvm::Value * a, llvm::Value * b);
     77    virtual llvm::Value * simd_max(unsigned fw, llvm::Value * a, llvm::Value * b);
     78    virtual llvm::Value * simd_umax(unsigned fw, llvm::Value * a, llvm::Value * b);
     79    virtual llvm::Value * simd_min(unsigned fw, llvm::Value * a, llvm::Value * b);
     80    virtual llvm::Value * simd_umin(unsigned fw, llvm::Value * a, llvm::Value * b);
     81    virtual llvm::Value * simd_if(unsigned fw, llvm::Value * cond, llvm::Value * a, llvm::Value * b);
    8582   
    86     virtual Value * simd_slli(unsigned fw, Value * a, unsigned shift);
    87     virtual Value * simd_srli(unsigned fw, Value * a, unsigned shift);
    88     virtual Value * simd_srai(unsigned fw, Value * a, unsigned shift);
     83    virtual llvm::Value * simd_slli(unsigned fw, llvm::Value * a, unsigned shift);
     84    virtual llvm::Value * simd_srli(unsigned fw, llvm::Value * a, unsigned shift);
     85    virtual llvm::Value * simd_srai(unsigned fw, llvm::Value * a, unsigned shift);
    8986   
    90     virtual Value * simd_cttz(unsigned fw, Value * a);
    91     virtual Value * simd_popcount(unsigned fw, Value * a);
     87    virtual llvm::Value * simd_cttz(unsigned fw, llvm::Value * a);
     88    virtual llvm::Value * simd_popcount(unsigned fw, llvm::Value * a);
    9289   
    93     virtual Value * esimd_mergeh(unsigned fw, Value * a, Value * b);
    94     virtual Value * esimd_mergel(unsigned fw, Value * a, Value * b);
    95     virtual Value * esimd_bitspread(unsigned fw, Value * bitmask);
     90    virtual llvm::Value * esimd_mergeh(unsigned fw, llvm::Value * a, llvm::Value * b);
     91    virtual llvm::Value * esimd_mergel(unsigned fw, llvm::Value * a, llvm::Value * b);
     92    virtual llvm::Value * esimd_bitspread(unsigned fw, llvm::Value * bitmask);
    9693   
    97     virtual Value * hsimd_packh(unsigned fw, Value * a, Value * b);
    98     virtual Value * hsimd_packl(unsigned fw, Value * a, Value * b);
    99     virtual Value * hsimd_packh_in_lanes(unsigned lanes, unsigned fw, Value * a, Value * b);
    100     virtual Value * hsimd_packl_in_lanes(unsigned lanes, unsigned fw, Value * a, Value * b);
     94    virtual llvm::Value * hsimd_packh(unsigned fw, llvm::Value * a, llvm::Value * b);
     95    virtual llvm::Value * hsimd_packl(unsigned fw, llvm::Value * a, llvm::Value * b);
     96    virtual llvm::Value * hsimd_packh_in_lanes(unsigned lanes, unsigned fw, llvm::Value * a, llvm::Value * b);
     97    virtual llvm::Value * hsimd_packl_in_lanes(unsigned lanes, unsigned fw, llvm::Value * a, llvm::Value * b);
    10198
    102     virtual Value * hsimd_signmask(unsigned fw, Value * a);
     99    virtual llvm::Value * hsimd_signmask(unsigned fw, llvm::Value * a);
    103100   
    104     virtual Value * mvmd_extract(unsigned fw, Value * a, unsigned fieldIndex);
    105     virtual Value * mvmd_insert(unsigned fw, Value * blk, Value * elt, unsigned fieldIndex);
    106     virtual Value * mvmd_slli(unsigned fw, Value * a, unsigned shift);
    107     virtual Value * mvmd_srli(unsigned fw, Value * a, unsigned shift);
    108     virtual Value * mvmd_dslli(unsigned fw, Value * a, Value * b, unsigned shift);
     101    virtual llvm::Value * mvmd_extract(unsigned fw, llvm::Value * a, unsigned fieldIndex);
     102    virtual llvm::Value * mvmd_insert(unsigned fw, llvm::Value * blk, llvm::Value * elt, unsigned fieldIndex);
     103    virtual llvm::Value * mvmd_slli(unsigned fw, llvm::Value * a, unsigned shift);
     104    virtual llvm::Value * mvmd_srli(unsigned fw, llvm::Value * a, unsigned shift);
     105    virtual llvm::Value * mvmd_dslli(unsigned fw, llvm::Value * a, llvm::Value * b, unsigned shift);
    109106   
    110107   
    111     virtual Value * bitblock_any(Value * a);
     108    virtual llvm::Value * bitblock_any(llvm::Value * a);
    112109    // full add producing {carryout, sum}
    113     virtual std::pair<Value *, Value *> bitblock_add_with_carry(Value * a, Value * b, Value * carryin);
     110    virtual std::pair<llvm::Value *, llvm::Value *> bitblock_add_with_carry(llvm::Value * a, llvm::Value * b, llvm::Value * carryin);
    114111    // full shift producing {shiftout, shifted}
    115     virtual std::pair<Value *, Value *> bitblock_advance(Value * a, Value * shiftin, unsigned shift);
    116     virtual Value * bitblock_mask_from(Value * pos);
    117     virtual Value * bitblock_set_bit(Value * pos);
     112    virtual std::pair<llvm::Value *, llvm::Value *> bitblock_advance(llvm::Value * a, llvm::Value * shiftin, unsigned shift);
     113    virtual llvm::Value * bitblock_mask_from(llvm::Value * pos);
     114    virtual llvm::Value * bitblock_set_bit(llvm::Value * pos);
    118115   
    119     Value * simd_and(Value * a, Value * b);
    120     Value * simd_or(Value * a, Value * b);
    121     Value * simd_xor(Value * a, Value * b);
    122     Value * simd_not(Value * a);
    123     Value * fwCast(unsigned fw, Value * a);
     116    llvm::Value * simd_and(llvm::Value * a, llvm::Value * b);
     117    llvm::Value * simd_or(llvm::Value * a, llvm::Value * b);
     118    llvm::Value * simd_xor(llvm::Value * a, llvm::Value * b);
     119    llvm::Value * simd_not(llvm::Value * a);
     120    llvm::Value * fwCast(unsigned fw, llvm::Value * a);
    124121   
    125     inline VectorType * getBitBlockType() const {
     122    inline llvm::VectorType * getBitBlockType() const {
    126123        return mBitBlockType;
    127124    }
    128125
    129     inline Type * getStreamSetTy(const unsigned NumElements = 1, const unsigned FieldWidth = 1) {
    130         return ArrayType::get(getStreamTy(FieldWidth), NumElements);
     126    inline llvm::ArrayType * getStreamSetTy(const unsigned NumElements = 1, const unsigned FieldWidth = 1) {
     127        return llvm::ArrayType::get(getStreamTy(FieldWidth), NumElements);
    131128    }
    132129   
    133     Type * getStreamTy(const unsigned FieldWidth = 1);
     130    StreamType * getStreamTy(const unsigned FieldWidth = 1);
    134131
    135     void CallPrintRegister(const std::string & regName, Value * const value);
     132    void CallPrintRegister(const std::string & regName, llvm::Value * const value);
    136133   
    137134protected:
    138135    unsigned            mBitBlockWidth;
    139136    unsigned            mStride;
    140     VectorType *        mBitBlockType;
     137    llvm::VectorType *  mBitBlockType;
    141138
    142     Constant *          mZeroInitializer;
    143     Constant *          mOneInitializer;
    144     Constant *          mPrintRegisterFunction;
     139    llvm::Constant *    mZeroInitializer;
     140    llvm::Constant *    mOneInitializer;
     141    llvm::Constant *    mPrintRegisterFunction;
    145142    StreamTypes         mStreamTypes;
    146143};
    147144
    148 inline LoadInst * IDISA_Builder::CreateBlockAlignedLoad(Value * const ptr) {
     145inline llvm::LoadInst * IDISA_Builder::CreateBlockAlignedLoad(llvm::Value * const ptr) {
    149146    return CreateAlignedLoad(ptr, mBitBlockWidth / 8);
    150147}
    151148
    152 inline LoadInst * IDISA_Builder::CreateBlockAlignedLoad(Value * const ptr, Value * const index) {
     149inline llvm::LoadInst * IDISA_Builder::CreateBlockAlignedLoad(llvm::Value * const ptr, llvm::Value * const index) {
    153150    return CreateBlockAlignedLoad(CreateGEP(ptr, index));
    154151}
    155152
    156 inline LoadInst * IDISA_Builder::CreateBlockAlignedLoad(Value * const ptr, std::initializer_list<Value *> indices) {
     153inline llvm::LoadInst * IDISA_Builder::CreateBlockAlignedLoad(llvm::Value * const ptr, std::initializer_list<llvm::Value *> indices) {
    157154    return CreateBlockAlignedLoad(CreateGEP(ptr, indices));
    158155}
    159156
    160 inline void IDISA_Builder::CreateBlockAlignedStore(Value * const value, Value * const ptr) {
     157inline void IDISA_Builder::CreateBlockAlignedStore(llvm::Value * const value, llvm::Value * const ptr) {
    161158    CreateAlignedStore(value, ptr, mBitBlockWidth / 8);
    162159}
    163160
    164 inline void IDISA_Builder::CreateBlockAlignedStore(Value * const value, Value * const ptr, Value * const index) {
     161inline void IDISA_Builder::CreateBlockAlignedStore(llvm::Value * const value, llvm::Value * const ptr, llvm::Value * const index) {
    165162    CreateBlockAlignedStore(value, CreateGEP(ptr, index));
    166163}
    167164
    168 inline void IDISA_Builder::CreateBlockAlignedStore(Value * const value, Value * const ptr, std::initializer_list<Value *> indices) {
     165inline void IDISA_Builder::CreateBlockAlignedStore(llvm::Value * const value, llvm::Value * const ptr, std::initializer_list<llvm::Value *> indices) {
    169166    CreateBlockAlignedStore(value, CreateGEP(ptr, indices));
    170167}
  • icGREP/icgrep-devel/icgrep/IR_Gen/idisa_i64_builder.cpp

    r4977 r5260  
    1010#include <llvm/IR/Intrinsics.h>
    1111#include <llvm/IR/Function.h>
     12#include <llvm/IR/Module.h>
    1213
    1314namespace IDISA {
  • icGREP/icgrep-devel/icgrep/IR_Gen/idisa_i64_builder.h

    r5238 r5260  
    77 *  icgrep is a trademark of International Characters.
    88 */
    9 #include <llvm/IR/Module.h>
    10 #include <llvm/IR/Constant.h>
    11 #include <llvm/IR/Type.h>
    12 #include <llvm/IR/Value.h>
    139#include <IR_Gen/idisa_builder.h>
    1410
  • icGREP/icgrep-devel/icgrep/IR_Gen/idisa_nvptx_builder.cpp

    r5230 r5260  
    1111#include <llvm/IR/Function.h>
    1212#include <llvm/IR/InlineAsm.h>
    13 #include <sstream>
     13#include <llvm/IR/Module.h>
    1414
    1515namespace IDISA {
     
    256256    Value * conv = CreateZExt(input, int32ty);
    257257
    258     std::ostringstream AsmStream;
    259     AsmStream << "{.reg .pred %p1; ";
    260     AsmStream << "setp.ne.u32 %p1, $1, 0; ";
    261     AsmStream << "vote.ballot.b32  $0, %p1;}";
     258    const char * AsmStream = "{.reg .pred %p1;"
     259                             "setp.ne.u32 %p1, $1, 0;"
     260                             "vote.ballot.b32  $0, %p1;}";
    262261    FunctionType * AsmFnTy = FunctionType::get(int32ty, int32ty, false);
    263     llvm::InlineAsm *IA = llvm::InlineAsm::get(AsmFnTy, AsmStream.str(), "=r,r", true, false);
     262    llvm::InlineAsm *IA = llvm::InlineAsm::get(AsmFnTy, AsmStream, "=r,r", true, false);
    264263    llvm::CallInst * result = CreateCall(IA, conv);
    265264    result->addAttribute(llvm::AttributeSet::FunctionIndex, llvm::Attribute::NoUnwind);
  • icGREP/icgrep-devel/icgrep/IR_Gen/idisa_nvptx_builder.h

    r5238 r5260  
    77*/
    88
    9 #include <IR_Gen/idisa_builder.h>
    109#include <IR_Gen/idisa_i64_builder.h>
    11 #include <iostream>
     10
    1211using namespace llvm;
    1312
  • icGREP/icgrep-devel/icgrep/IR_Gen/idisa_sse_builder.cpp

    r5118 r5260  
    1010#include <llvm/IR/Intrinsics.h>
    1111#include <llvm/IR/Function.h>
    12 #include <iostream>
     12#include <llvm/IR/Module.h>
    1313
    1414namespace IDISA {
  • icGREP/icgrep-devel/icgrep/IR_Gen/idisa_target.cpp

    r5238 r5260  
    44 */
    55
     6#include "idisa_target.h"
    67#include <toolchain.h>
    78#include <IR_Gen/idisa_avx_builder.h>
  • icGREP/icgrep-devel/icgrep/IR_Gen/idisa_target.h

    r5238 r5260  
    77#define IDISA_TARGET_H
    88
    9 #include <llvm/IR/Module.h>
    10 #include <llvm/IR/Type.h>
    11 #include <IR_Gen/idisa_builder.h>
     9namespace llvm { class Module; }
     10namespace IDISA { class IDISA_Builder; }
    1211
    1312namespace IDISA {
    1413   
    15 IDISA::IDISA_Builder * GetIDISA_Builder(Module * m);
     14IDISA::IDISA_Builder * GetIDISA_Builder(llvm::Module * m);
    1615
    17 IDISA::IDISA_Builder * GetIDISA_GPU_Builder(Module * m);
     16IDISA::IDISA_Builder * GetIDISA_GPU_Builder(llvm::Module * m);
    1817
    1918}
  • icGREP/icgrep-devel/icgrep/IR_Gen/types/streamtype.cpp

    r5238 r5260  
    11#include "streamtype.h"
    2 #include "IR_Gen/idisa_builder.h"
     2#include <IR_Gen/idisa_builder.h>  // for IDISA_Builder
     3#include <llvm/IR/DerivedTypes.h>  // for ArrayType, VectorType
    34
    45namespace IDISA {
     
    67llvm::Type * StreamType::resolveType(IDISA_Builder * const builder) {
    78    if (mFieldWidth == 1) return builder->getBitBlockType();
    8     return ArrayType::get(builder->getBitBlockType(), mFieldWidth);
     9    return llvm::ArrayType::get(builder->getBitBlockType(), mFieldWidth);
    910//    return llvm::VectorType::get(builder->getIntNTy(mFieldWidth), builder->getBitBlockWidth() / mFieldWidth);
    1011}
  • icGREP/icgrep-devel/icgrep/IR_Gen/types/streamtype.h

    r5230 r5260  
    22#define STREAMTYPE_H
    33
    4 #include <llvm/IR/DerivedTypes.h>
    5 #include <llvm/IR/LLVMContext.h>
     4#include <llvm/IR/Type.h>
     5namespace IDISA { class IDISA_Builder; }
     6namespace llvm { class LLVMContext; }
    67
    78namespace IDISA {
Note: See TracChangeset for help on using the changeset viewer.