source: icGREP/icgrep-devel/icgrep/pablo/pe_ones.h @ 5299

Last change on this file since 5299 was 5283, checked in by nmedfort, 3 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: 932 bytes
Line 
1/*
2 *  Copyright (c) 2014 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 *  icgrep is a trademark of International Characters.
5 */
6
7#ifndef PE_ONES_H
8#define PE_ONES_H
9
10#include <pablo/pabloAST.h>
11
12namespace pablo {
13
14class Ones : public PabloAST {
15    friend class PabloBlock;
16    friend class PabloKernel;
17public:
18    static inline bool classof(const PabloAST * e) {
19        return e->getClassTypeId() == ClassTypeId::Ones;
20    }
21    static inline bool classof(const void *) {
22        return false;
23    }
24    virtual ~Ones() {
25    }
26    inline bool operator==(const Ones &) const {
27        return true;
28    }
29    virtual bool operator==(const PabloAST & other) const {
30        return llvm::isa<Ones>(other);
31    }
32protected:
33    Ones(llvm::Type * const type, Allocator & allocator)
34    : PabloAST(ClassTypeId::Ones, type, allocator) {
35    }
36};
37
38}
39
40#endif // PE_ONES_H
41
42
Note: See TracBrowser for help on using the repository browser.