Ignore:
Timestamp:
Sep 7, 2017, 4:56:56 PM (2 years ago)
Author:
nmedfort
Message:

Partial check-in for avoidance of compiling Pablo/LLVM code to determine the Kernel struct type when using a cached object. Inactive RE alternation minimization check in.

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

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/carry_data.h

    r5366 r5630  
    1111
    1212class CarryData {
    13     friend class CarryManager;
    1413public:
    1514
    16     enum SummaryType : int {
    17         NoSummary
    18         , ImplicitSummary
    19         , BorrowedSummary
    20         , ExplicitSummary
     15    enum SummaryType : unsigned {
     16        NoSummary = 0
     17        , ImplicitSummary = 1
     18        , BorrowedSummary = 2
     19        , ExplicitSummary = 3
     20        , NonCarryCollapsingMode = 4
    2121    };
    2222
    2323    CarryData()
    24     : mSummaryType(NoSummary)
    25     , mInNonCollapsingCarryMode(false) {
     24    : mSummaryType(NoSummary) {
    2625
    2726    }
    2827             
    2928    bool hasSummary() const {
    30         return (mSummaryType != NoSummary);
     29        return (mSummaryType & (ImplicitSummary | BorrowedSummary | ExplicitSummary)) != NoSummary;
    3130    }
    3231   
    3332    bool hasImplicitSummary() const {
    34         return (mSummaryType == ImplicitSummary);
     33        return (mSummaryType & (ImplicitSummary | BorrowedSummary | ExplicitSummary)) == ImplicitSummary;
    3534    }
    3635
    3736    bool hasBorrowedSummary() const {
    38         return (mSummaryType == BorrowedSummary);
     37        return (mSummaryType & (ImplicitSummary | BorrowedSummary | ExplicitSummary)) == BorrowedSummary;
    3938    }
    4039
    4140    bool hasExplicitSummary() const {
    42         return (mSummaryType == ExplicitSummary);
     41        return (mSummaryType & (ImplicitSummary | BorrowedSummary | ExplicitSummary)) == ExplicitSummary;
    4342    }
    4443
    4544    bool nonCarryCollapsingMode() const {
    46         return mInNonCollapsingCarryMode;
     45        return (mSummaryType & (NonCarryCollapsingMode)) != 0;
    4746    }
    4847
     
    5251
    5352    void setNonCollapsingCarryMode(const bool value = true) {
    54         mInNonCollapsingCarryMode = value;
     53        if (value) {
     54            mSummaryType = (SummaryType)(mSummaryType | NonCarryCollapsingMode);
     55        } else {
     56            mSummaryType = (SummaryType)(mSummaryType & ~NonCarryCollapsingMode);
     57        }
    5558    }
    5659   
     
    5861
    5962    SummaryType     mSummaryType;
    60     bool            mInNonCollapsingCarryMode;
    6163
    6264};
  • icGREP/icgrep-devel/icgrep/pablo/carrypack_manager.cpp

    r5510 r5630  
    127127    mCarryGroup.resize(assignDefaultCarryGroups(kernel->getEntryBlock()));
    128128
    129     Type * const carryStateTy = analyse(iBuilder, kernel->getEntryBlock());
    130 
    131     kernel->addScalar(carryStateTy, "carries");
    132 
    133 //    iBuilder->CallPrintInt("carry state size:", ConstantExpr::getSizeOf(carryStateTy));
     129    kernel->setCarryDataTy(analyse(iBuilder, mCurrentScope));
     130
     131    kernel->addScalar(kernel->getCarryDataTy(), "carries");
    134132
    135133    if (mHasLoop) {
  • icGREP/icgrep-devel/icgrep/pablo/pablo_kernel.cpp

    r5620 r5630  
    125125}
    126126
    127 void PabloKernel::prepareKernel(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) {
     127void PabloKernel::addInternalKernelProperties(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) {
    128128    mSizeTy = iBuilder->getSizeTy();
    129129    mStreamTy = iBuilder->getStreamTy();
     
    132132    mPabloCompiler->initializeKernelData(iBuilder);
    133133    mSizeTy = nullptr;
    134     mStreamTy = nullptr;
    135     BlockOrientedKernel::prepareKernel(iBuilder);
     134    mStreamTy = nullptr;   
    136135}
    137136
  • icGREP/icgrep-devel/icgrep/pablo/pablo_kernel.h

    r5510 r5630  
    3131    friend class CarryManager;
    3232    friend class CarryPackManager;
     33    friend class ParabixObjectCache;
    3334
    3435public:
     
    124125    Integer * getInteger(const int64_t value) const;
    125126
     127    llvm::StructType * getCarryDataTy() const {
     128        return mCarryDataTy;
     129    }
     130
    126131protected:
    127132
     
    145150    llvm::IntegerType * getInt1Ty() const;
    146151
    147 private:
     152    void setCarryDataTy(llvm::StructType * const carryDataTy) {
     153        mCarryDataTy = carryDataTy;
     154    }
    148155
    149156    // A custom method for preparing kernel declarations is needed,
    150157    // so that the carry data requirements may be accommodated before
    151158    // finalizing the KernelStateType.
    152     void prepareKernel(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) final;
     159    void addInternalKernelProperties(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) final;
     160
     161private:
    153162
    154163    void generateDoBlockMethod(const std::unique_ptr<KernelBuilder> & iBuilder) final;
     
    169178    llvm::IntegerType *             mSizeTy;
    170179    llvm::VectorType *              mStreamTy;
     180    llvm::StructType *              mCarryDataTy;
    171181    std::vector<Var *>              mInputs;
    172182    std::vector<Var *>              mOutputs;
Note: See TracChangeset for help on using the changeset viewer.