source: icGREP/icgrep-devel/icgrep/kernels/scanmatchgen.h @ 5283

Last change on this file since 5283 was 5283, checked in by nmedfort, 2 years ago

Optimized Symbol Generation (and fixed potential bug that could allow duplicate names being constructed); made PabloKernel? extend PabloAST (temporarily removed PabloAST::getName() to avoid diamond problem); added an internal scalar to PabloKernel? struct for each Count to avoid InOut? output scalar variable problem; allowed CodeMotionPass? to move code within the same scope but across a branch statement. Began work on separating Kernels into either Block-Oriented or Segment-Oriented kernels.

File size: 1.3 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#ifndef SCANMATCHGEN_H
6#define SCANMATCHGEN_H
7
8#include "grep_type.h"  // for GrepType
9#include "kernel.h"     // for KernelBuilder
10namespace IDISA { class IDISA_Builder; }  // lines 16-16
11namespace llvm { class Function; }  // lines 14-14
12namespace llvm { class Module; }  // lines 14-14
13
14namespace kernel {
15   
16class ScanMatchKernel : public BlockOrientedKernel {
17public:
18    ScanMatchKernel(IDISA::IDISA_Builder * iBuilder, GrepType grepType) :
19    BlockOrientedKernel(iBuilder, "scanMatch",
20                  {Binding{iBuilder->getStreamSetTy(2, 1), "matchResults"}},
21                    {}, 
22                    {Binding{iBuilder->getInt8PtrTy(), "FileBuf"}, Binding{iBuilder->getSizeTy(), "FileSize"}, Binding{iBuilder->getSizeTy(), "FileIdx"}}, 
23                    {}, 
24                    {Binding{iBuilder->getSizeTy(), "BlockNo"}, Binding{iBuilder->getSizeTy(), "LineStart"}, Binding{iBuilder->getSizeTy(), "LineNum"}}),
25
26    mGrepType(grepType) {}
27       
28private:
29
30    void generateDoBlockMethod() const override;
31
32    llvm::Function * generateScanWordRoutine(llvm::Module * m) const;
33
34private:
35    GrepType mGrepType;
36};
37}
38
39#endif // SCANMATCHGEN_H
Note: See TracBrowser for help on using the repository browser.