Ignore:
Timestamp:
Feb 3, 2018, 12:02:14 PM (21 months ago)
Author:
cameron
Message:

Using DirectCC builder updates; speedup wc -l

File:
1 edited

Legend:

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

    r5832 r5861  
    1616namespace IDISA {
    1717
     18   
     19inline bool isStreamTy(llvm::Type * t) {
     20    return t->isVectorTy() && (t->getVectorNumElements() == 0);
     21}
     22
     23inline bool isStreamSetTy(llvm::Type * t) {
     24    return t->isArrayTy() && (isStreamTy(t->getArrayElementType()));
     25}
     26
     27inline unsigned getNumOfStreams (llvm::Type * t) {
     28    if (isStreamTy(t)) return 1;
     29    assert(isStreamSetTy(t));
     30    return t->getArrayNumElements();
     31}
     32
     33inline unsigned getStreamFieldWidth (llvm::Type * t) {
     34    if (isStreamTy(t)) return t->getScalarSizeInBits();
     35    assert(isStreamSetTy(t));
     36    return t->getArrayElementType()->getScalarSizeInBits();
     37}
     38
     39   
    1840class IDISA_Builder : public CBuilder {
    1941
     
    168190        return getStreamSetTy(getContext(), NumElements, FieldWidth);
    169191    }
    170 
     192   
    171193    void CallPrintRegister(const std::string & regName, llvm::Value * const value);
    172194
Note: See TracChangeset for help on using the changeset viewer.