Ignore:
Timestamp:
Feb 3, 2017, 2:31:24 PM (2 years ago)
Author:
nmedfort
Message:

Removed StreamType? in favour of 0-length VectorType?.

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

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/codegenstate.cpp

    r5283 r5298  
    2929    assert ("DIFFERING TYPES" && ((A)->getType() == (B)->getType()))
    3030
    31 using StreamType = IDISA::StreamType;
    3231using namespace llvm;
    33 
    34 inline void printType(const Type * type, raw_string_ostream & out) {
    35     if (auto st = dyn_cast<StreamType>(type)) {
    36         out << "s" << st->getFieldWidth();
    37         return;
    38     }
    39     if (auto ty = dyn_cast<ArrayType>(type)) {
    40         unsigned numElems = ty->getNumElements();
    41         auto elemTy = ty->getElementType();
    42         if (auto st = dyn_cast<StreamType>(elemTy)) {
    43             out << "<" << numElems << " x s" << st->getFieldWidth() << ">";
    44             return;
    45         }
    46     }
    47     type->print(out);
    48 }
    4932
    5033namespace pablo {
     
    216199        case AssignErrorType::TypeMismatch:
    217200            out << "type mismatch ";
    218             printType(value->getType(), out);
     201            value->getType()->print(out);
    219202            out << " vs. ";
    220             printType(var->getType(), out);
     203            var->getType()->print(out);
    221204            break;
    222205        case AssignErrorType::ReadOnlyVar:
  • icGREP/icgrep-devel/icgrep/pablo/pablo_kernel.cpp

    r5297 r5298  
    2020using namespace llvm;
    2121
     22inline bool isStreamType(const Type * ty) {
     23    if (ty->isArrayTy()) {
     24        ty = ty->getArrayElementType();
     25    }
     26    if (ty->isVectorTy()) {
     27        return (ty->getVectorNumElements() == 0);
     28    }
     29    return false;
     30}
     31
    2232Var * PabloKernel::addInput(const std::string & name, Type * const type) {
    2333    Var * param = new (mAllocator) Var(mSymbolTable->makeString(name, iBuilder), type, mAllocator, Var::ReadOnly);
     
    2535    mInputs.push_back(param);
    2636    mVariables.push_back(param);
    27     if (isa<ArrayType>(type) || isa<StreamType>(type)) {
     37    if (isStreamType(type)) {
    2838        mStreamSetInputs.emplace_back(type, name);
    2939    } else {
     
    3949    mOutputs.push_back(result);
    4050    mVariables.push_back(result);
    41     if (isa<ArrayType>(type) || isa<StreamType>(type)) {
     51    if (isStreamType(type)) {
    4252        mStreamSetOutputs.emplace_back(type, name);
    4353    } else {
Note: See TracChangeset for help on using the changeset viewer.