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

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

Location:
icGREP/icgrep-devel/icgrep/pablo
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/builder.hpp

    r5227 r5229  
    191191    }
    192192
     193    Type * getStreamTy(const uint64_t FieldWidth = 1) {
     194        return mPb->getStreamTy(FieldWidth);
     195    }
     196   
    193197    Type * getStreamSetTy(const uint64_t NumElements = 1, const uint64_t FieldWidth = 1) {
    194198        return mPb->getStreamSetTy(NumElements, FieldWidth);
    195199    }
    196 
     200   
    197201    /// Statement Iterator Wrappers
    198202
  • icGREP/icgrep-devel/icgrep/pablo/codegenstate.cpp

    r5227 r5229  
    1515inline void printType(const Type * type, raw_string_ostream & out) {
    1616    if (auto st = dyn_cast<StreamType>(type)) {
    17         out << "<" << st->getNumElements() << " x s" << st->getFieldWidth() << ">";
    18     } else {
    19         type->print(out);
    20     }
     17        out << "s" << st->getFieldWidth();
     18        return;
     19    }
     20    if (auto ty = dyn_cast<ArrayType>(type)) {
     21        unsigned numElems = ty->getNumElements();
     22        auto elemTy = ty->getElementType();
     23        if (auto st = dyn_cast<StreamType>(elemTy)) {
     24            out << "<" << numElems << " x s" << st->getFieldWidth() << ">";
     25            return;
     26        }
     27    }
     28    type->print(out);
    2129}
    2230
     
    5159Var * PabloBlock::createVar(PabloAST * name, Type * type) {
    5260    if (type == nullptr) {
    53         type = getParent()->getStreamSetTy();
     61        type = getParent()->getBuilder()->getStreamTy();
    5462    }
    5563    if (LLVM_UNLIKELY(name == nullptr || !isa<String>(name))) {
  • icGREP/icgrep-devel/icgrep/pablo/codegenstate.h

    r5227 r5229  
    261261    While * createWhile(PabloAST * condition, PabloBlock * body);
    262262
     263    Type * getStreamTy(const uint64_t FieldWidth = 1) {
     264        return mParent->getStreamTy(FieldWidth);
     265    }
     266   
    263267    Type * getStreamSetTy(const uint64_t NumElements = 1, const uint64_t FieldWidth = 1) {
    264268        return mParent->getStreamSetTy(NumElements, FieldWidth);
    265269    }
    266 
     270   
    267271    inline PabloBlock * getPredecessor() const {
    268272        return getBranch() ? getBranch()->getParent() : nullptr;
  • icGREP/icgrep-devel/icgrep/pablo/pablo_kernel.cpp

    r5227 r5229  
    2222    Var * param = new Var(mSymbolTable->make(name), type, true);
    2323    mInputs.push_back(param);
    24     if (isa<StreamType>(type)) {
     24    if (isa<ArrayType>(type) || isa<StreamType>(type)) {
    2525        mStreamSetInputs.emplace_back(type, name);
    2626    } else {
     
    3434    Var * result = new Var(mSymbolTable->make(name), type, false);
    3535    mOutputs.push_back(result);
    36     if (isa<StreamType>(type)) {
     36    if (isa<ArrayType>(type) || isa<StreamType>(type)) {
    3737        mStreamSetOutputs.emplace_back(type, name);
    3838    } else {
     
    5151Zeroes * PabloKernel::getNullValue(Type * type) {
    5252    if (type == nullptr) {
    53         type = getStreamSetTy();
     53        type = getStreamTy();
    5454    }
    5555    for (PabloAST * constant : mConstants) {
     
    6565Ones * PabloKernel::getAllOnesValue(Type * type) {
    6666    if (type == nullptr) {
    67         type = getStreamSetTy();
     67        type = getStreamTy();
    6868    }
    6969    for (PabloAST * constant : mConstants) {
Note: See TracChangeset for help on using the changeset viewer.