Ignore:
Timestamp:
Mar 30, 2017, 8:12:59 PM (2 years ago)
Author:
cameron
Message:

Lookahead support

File:
1 edited

Legend:

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

    r5371 r5383  
    506506            PabloAST * stream = l->getExpr();
    507507            Value * index = iBuilder->getInt32(0);
    508 
    509508            if (LLVM_UNLIKELY(isa<Extract>(stream))) {
    510                 stream = cast<Extract>(stream)->getArray();
     509                var = dyn_cast<Var>(cast<Extract>(stream)->getArray());
    511510                index = compileExpression(cast<Extract>(stream)->getIndex());
     511                if (!var->isKernelParameter() || var->isReadNone()) {
     512                    std::string tmp;
     513                    raw_string_ostream out(tmp);
     514                    out << "Lookahead operation cannot be applied to ";
     515                    stmt->print(out);
     516                    out << " - not an input stream";
     517                    report_fatal_error(out.str());
     518                }
    512519            }
    513520            if (LLVM_LIKELY(isa<Var>(stream))) {
     
    524531                }
    525532            }
    526 
    527533            const auto bit_shift = (l->getAmount() % iBuilder->getBitBlockWidth());
    528534            const auto block_shift = (l->getAmount() / iBuilder->getBitBlockWidth());
Note: See TracChangeset for help on using the changeset viewer.