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

Last change on this file since 4992 was 4992, checked in by nmedfort, 3 years ago

Continued work on symbol table.

File size: 1.8 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 <IDISA/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(Type * const transposedVectorType, const unsigned minCount, const unsigned maxCount);
36
37    Value * generateGather(Value * const base, Value * const vindex);
38    Value * generateMaskedGather(Value * const base, Value * const vindex, Value * const mask);
39
40    void generateLLVMParser();
41
42private:
43    llvm::Module *                      mMod;
44    IDISA::IDISA_Builder *              iBuilder;
45    KernelBuilder *                     mS2PKernel;
46    KernelBuilder *                     mLeadingKernel;
47    KernelBuilder *                     mSortingKernel;
48    KernelBuilder *                     mGatherKernel;
49
50    unsigned                            mLongestLookahead;
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.