source: icGREP/icgrep-devel/icgrep/kernels/symboltablepipeline.h @ 5257

Last change on this file since 5257 was 5238, checked in by cameron, 3 years ago

IR_Gen subdirectory for all IR generation utility functions

File size: 1.7 KB
Line 
1/*
2 *  Copyright (c) 2016 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 */
5
6#ifndef SYMBOLTABLEPIPELINE_H
7#define SYMBOLTABLEPIPELINE_H
8
9#include <IR_Gen/idisa_builder.h>
10#include "kernel.h"
11
12namespace llvm {
13    class Module;
14    class Function;
15    class Type;
16}
17
18namespace pablo { class PabloFunction; class PabloBlock; }
19
20namespace kernel {
21
22class SymbolTableBuilder {
23public:
24    SymbolTableBuilder(llvm::Module * m, IDISA::IDISA_Builder * b);
25    ~SymbolTableBuilder();
26    void createKernels();
27    llvm::Function * ExecuteKernels();
28
29protected:
30
31    pablo::PabloFunction * generateLeadingFunction(const std::vector<unsigned> & endpoints);
32    pablo::PabloFunction * generateSortingFunction(const pablo::PabloFunction * const leading, const std::vector<unsigned> & endpoints);
33
34    void generateGatherKernel(KernelBuilder * kBuilder, const std::vector<unsigned> & endpoints, const unsigned scanWordBitWidth = 64);
35    Function * generateGatherFunction(const unsigned minKeyLength, const unsigned maxKeyLength);
36
37    Value * generateMaskedGather(Value * const base, Value * const vindex, Value * const mask);
38
39private:
40    llvm::Module *                      mMod;
41    IDISA::IDISA_Builder *              iBuilder;
42    KernelBuilder *                     mS2PKernel;
43    KernelBuilder *                     mLeadingKernel;
44    KernelBuilder *                     mSortingKernel;
45    KernelBuilder *                     mGatherKernel;
46
47    unsigned                            mLongestLookahead;
48
49    std::vector<Function *>             mGatherFunction;
50
51    llvm::Type *                        mBitBlockType;
52    int                                 mBlockSize;
53};
54
55}
56
57#endif // SYMBOLTABLEPIPELINE_H
Note: See TracBrowser for help on using the repository browser.