Ignore:
Timestamp:
May 12, 2017, 4:54:11 PM (2 years ago)
Author:
nmedfort
Message:

Refactoring work + correction for getRawItemPointer

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

Legend:

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

    r5436 r5446  
    118118    }
    119119
    120     llvm::VectorType * getStreamTy(const unsigned FieldWidth = 1) {
    121         return llvm::VectorType::get(llvm::IntegerType::getIntNTy(getContext(), FieldWidth), 0);
     120    static llvm::VectorType * getStreamTy(llvm::LLVMContext & C, const unsigned FieldWidth = 1) {
     121        return llvm::VectorType::get(llvm::IntegerType::getIntNTy(C, FieldWidth), 0);
    122122    }
    123123
    124     inline llvm::ArrayType * getStreamSetTy(const unsigned NumElements = 1, const unsigned FieldWidth = 1) {
    125         return llvm::ArrayType::get(getStreamTy(FieldWidth), NumElements);
     124    static llvm::ArrayType * getStreamSetTy(llvm::LLVMContext & C, const unsigned NumElements = 1, const unsigned FieldWidth = 1) {
     125        return llvm::ArrayType::get(getStreamTy(C, FieldWidth), NumElements);
     126    }
     127
     128    llvm::VectorType * getStreamTy(const unsigned FieldWidth = 1) {
     129        return getStreamTy(getContext(), FieldWidth);
     130    }
     131
     132    llvm::ArrayType * getStreamSetTy(const unsigned NumElements = 1, const unsigned FieldWidth = 1) {
     133        return getStreamSetTy(getContext(), NumElements, FieldWidth);
    126134    }
    127135
  • icGREP/icgrep-devel/icgrep/IR_Gen/idisa_target.cpp

    r5436 r5446  
    1919namespace IDISA {
    2020   
    21 KernelBuilder * GetIDISA_Builder(llvm::Module * const module) {
     21KernelBuilder * GetIDISA_Builder(llvm::LLVMContext & C, const std::string & targetTriple) {
    2222    unsigned registerWidth = 0;
    23     Triple T(module->getTargetTriple());
     23    Triple T(targetTriple);
    2424    if (T.isArch64Bit()) {
    2525        registerWidth = 64;
     
    3535    if (codegen::BlockSize >= 256) {
    3636        if (hasAVX2) {
    37             return new KernelBuilderImpl<IDISA_AVX2_Builder>(module->getContext(), registerWidth, codegen::BlockSize, codegen::BlockSize);
     37            return new KernelBuilderImpl<IDISA_AVX2_Builder>(C, registerWidth, codegen::BlockSize, codegen::BlockSize);
    3838        }
    3939    } else if (codegen::BlockSize == 64) {
    40         return new KernelBuilderImpl<IDISA_I64_Builder>(module->getContext(), registerWidth, codegen::BlockSize, codegen::BlockSize);
     40        return new KernelBuilderImpl<IDISA_I64_Builder>(C, registerWidth, codegen::BlockSize, codegen::BlockSize);
    4141    }
    42     return new KernelBuilderImpl<IDISA_SSE2_Builder>(module->getContext(), registerWidth, codegen::BlockSize, codegen::BlockSize);
     42    return new KernelBuilderImpl<IDISA_SSE2_Builder>(C, registerWidth, codegen::BlockSize, codegen::BlockSize);
    4343}
    4444
    45 KernelBuilder * GetIDISA_GPU_Builder(llvm::Module * const module) {
    46     return new KernelBuilderImpl<IDISA_NVPTX20_Builder>(module->getContext(), 64, 64, 64);
     45KernelBuilder * GetIDISA_GPU_Builder(llvm::LLVMContext & C) {
     46    return new KernelBuilderImpl<IDISA_NVPTX20_Builder>(C, 64, 64, 64);
    4747}
    4848
  • icGREP/icgrep-devel/icgrep/IR_Gen/idisa_target.h

    r5435 r5446  
    77#define IDISA_TARGET_H
    88
     9namespace llvm { class LLVMContext; }
     10namespace kernel { class KernelBuilder; }
    911#include <string>
    10 namespace llvm { class Module; }
    11 namespace kernel { class KernelBuilder; }
    1212
    1313namespace IDISA {
    1414   
    15 kernel::KernelBuilder * GetIDISA_Builder(llvm::Module * const module);
     15kernel::KernelBuilder * GetIDISA_Builder(llvm::LLVMContext & C, const std::string & targetTriple);
    1616
    17 kernel::KernelBuilder * GetIDISA_GPU_Builder(llvm::Module * const module);
     17kernel::KernelBuilder * GetIDISA_GPU_Builder(llvm::LLVMContext & C);
    1818
    1919}
Note: See TracChangeset for help on using the changeset viewer.