Ignore:
Timestamp:
Jan 14, 2017, 3:49:56 PM (3 years ago)
Author:
nmedfort
Message:

Changes working towards simplifying accessing stream elements + some modifications to simplify include / forward declarations within the CodeGen? library.

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

Legend:

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

    r5246 r5260  
    66
    77#include <pablo/pablo_compiler.h>
     8#include <pablo/pablo_kernel.h>
    89#include <pablo/pablo_toolchain.h>
    910#include <pablo/codegenstate.h>
     
    1112#include <pablo/printer_pablos.h>
    1213#include <pablo/prototype.h>
    13 #include <re/re_name.h>
    1414#include <stdexcept>
    1515#include <sstream>
     
    5454            input = mKernel->getScalarFieldPtr(mSelf, name);
    5555        } else {
    56             input = mKernel->getStreamSetBlockPtr(mSelf, name, blockNo);
     56            input = mKernel->getStreamSetPtr(mSelf, name, blockNo);
    5757        }
    5858        mMarkerMap.emplace(var, input);
     
    6666            output = mKernel->getScalarFieldPtr(mSelf, name);
    6767        } else {
    68             output = mKernel->getStreamSetBlockPtr(mSelf, name, blockNo);
     68            output = mKernel->getStreamSetPtr(mSelf, name, blockNo);
    6969        }
    7070        mMarkerMap.emplace(var, output);
     
    452452            std::string inputName = var->getName()->to_string();;
    453453            Value * blockNo = mKernel->getScalarField(mSelf, blockNoScalar);
    454             Value * lookAhead_blockPtr  = mKernel->getStreamSetBlockPtr(mSelf, inputName, iBuilder->CreateAdd(blockNo, iBuilder->getSize(block_shift)));
     454            Value * lookAhead_blockPtr  = mKernel->getStreamSetPtr(mSelf, inputName, iBuilder->CreateAdd(blockNo, iBuilder->getSize(block_shift)));
    455455            Value * lookAhead_inputPtr = iBuilder->CreateGEP(lookAhead_blockPtr, {iBuilder->getInt32(0), iBuilder->getInt32(index)});
    456456            Value * lookAhead = iBuilder->CreateBlockAlignedLoad(lookAhead_inputPtr);
     
    458458                value = lookAhead;
    459459            } else { // Need to form shift result from two adjacent blocks.
    460                 Value * lookAhead_blockPtr1  = mKernel->getStreamSetBlockPtr(mSelf, inputName, iBuilder->CreateAdd(blockNo, iBuilder->getSize(block_shift + 1)));
     460                Value * lookAhead_blockPtr1  = mKernel->getStreamSetPtr(mSelf, inputName, iBuilder->CreateAdd(blockNo, iBuilder->getSize(block_shift + 1)));
    461461                Value * lookAhead_inputPtr1 = iBuilder->CreateGEP(lookAhead_blockPtr1, {iBuilder->getInt32(0), iBuilder->getInt32(index)});
    462462                Value * lookAhead1 = iBuilder->CreateBlockAlignedLoad(lookAhead_inputPtr1);
  • icGREP/icgrep-devel/icgrep/pablo/pablo_compiler.h

    r5238 r5260  
    88#define PABLO_COMPILER_H
    99
    10 //Pablo Expressions
    11 #include <string>
    12 #include <vector>
    1310#include <unordered_map>
    14 #include <pablo/pablo_kernel.h>
    15 #include <llvm/ADT/Twine.h>
    1611#include <llvm/IR/IRBuilder.h>
    1712#include <IR_Gen/idisa_builder.h>
     
    2015
    2116namespace llvm {
    22     class Value;
    23     class Module;
    24     class ExecutionEngine;
    25     class VectorType;
    26     class PointerType;
    27     class Constant;
    28     class FunctionType;
    29     class Function;
    30     class BasicBlock;
     17class Value;
     18class Function;
    3119}
    3220
     
    3523class PabloAST;
    3624class PabloBlock;
     25class PabloKernel;
    3726class String;
    38 class Var;
    3927class Statement;
    40 class StatementList;
    4128class If;
    4229class While;
    4330class CarryManager;
    44 class Extract;
    4531
    4632class PabloCompiler {
     
    4834
    4935    using IntSet = boost::container::flat_set<unsigned>;
    50     using MarkerMap = std::unordered_map<const PabloAST *, Value *>;
     36    using MarkerMap = std::unordered_map<const PabloAST *, llvm::Value *>;
    5137
    5238public:
     
    5440    ~PabloCompiler();
    5541    void initializeKernelData();
    56     void compile(Value * const self, Function * doBlockFunction);
     42    void compile(llvm::Value * const self, llvm::Function * doBlockFunction);
    5743
    5844private:
     
    6652    void compileWhile(const While * whileStmt);
    6753
    68     Value * compileExpression(const PabloAST * expr, const bool ensureLoaded = true) const;
     54    llvm::Value * compileExpression(const PabloAST * expr, const bool ensureLoaded = true) const;
    6955
    7056private:
     
    7359    CarryManager *          mCarryManager;
    7460    PabloKernel *           mKernel;
    75     Value *                 mSelf;
    76     Function *              mFunction;
     61    llvm::Value *           mSelf;
     62    llvm::Function *        mFunction;
    7763    MarkerMap               mMarkerMap;
    7864    IntSet                  mInputStreamOffset;
  • icGREP/icgrep-devel/icgrep/pablo/pablo_kernel.cpp

    r5250 r5260  
    44 */
    55
    6 #include <pablo/pablo_kernel.h>
     6#include "pablo_kernel.h"
    77#include <pablo/codegenstate.h>
    88#include <pablo/pablo_compiler.h>
    9 // #include <llvm/Support/Debug.h>
    109#include <pablo/pe_var.h>
     10#include <llvm/IR/Module.h>
    1111#include <llvm/IR/Verifier.h>
    1212#include <IR_Gen/idisa_builder.h>
Note: See TracChangeset for help on using the changeset viewer.