Ignore:
Timestamp:
Dec 19, 2016, 12:58:29 PM (2 years ago)
Author:
cameron
Message:

Distinguishing between StreamType? and StreamSetType?; fixing StreamSetBlock? pointer calculations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/kernels/streamset.h

    r5217 r5229  
    6767    void setEndOfInput(Value * bufferStructPtr);
    6868   
     69    llvm::Type * resolveStreamTypes(llvm::Type * type) {
     70        if (auto ty = dyn_cast<ArrayType>(type)) {
     71            unsigned numElems = ty->getNumElements();
     72            auto elemTy = ty->getElementType();
     73            if (isa<IDISA::StreamType>(elemTy)) {
     74                return ArrayType::get(cast<IDISA::StreamType>(elemTy)->resolveType(iBuilder), numElems);
     75            }
     76        }
     77        else if (auto ty = dyn_cast<IDISA::StreamType>(type)) {
     78            return ty->resolveType(iBuilder);
     79        }
     80        return type;
     81    }
     82   
    6983protected:
    7084    StreamSetBuffer(BufferKind k, IDISA::IDISA_Builder * b, llvm::Type * type, unsigned blocks, unsigned AddressSpace = 0)
    7185    : mBufferKind(k)
    7286    , iBuilder(b)
    73     , mStreamSetType(isa<IDISA::StreamType>(type) ? cast<IDISA::StreamType>(type)->resolveType(b) : type)
     87    , mStreamSetType(resolveStreamTypes(type))
    7488    , mBufferBlocks(blocks)
    7589    , mAddrSpace(AddressSpace)
Note: See TracChangeset for help on using the changeset viewer.