diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2016-10-02 14:10:10 -0600 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2016-10-02 14:10:10 -0600 |
commit | d2176835fc6e497a6c3e19b4630745c3911bde2c (patch) | |
tree | ad4b207876c32f80dc62ccce47cf99458d8a2e5e /include | |
parent | db3ff28ba74ff76aaac9e73d1b208e17992864cb (diff) | |
download | chill-d2176835fc6e497a6c3e19b4630745c3911bde2c.tar.gz chill-d2176835fc6e497a6c3e19b4630745c3911bde2c.tar.bz2 chill-d2176835fc6e497a6c3e19b4630745c3911bde2c.zip |
fixes
Diffstat (limited to 'include')
-rw-r--r-- | include/chillAST/chillAST_node.hh | 2 | ||||
-rwxr-xr-x | include/ir_clang.hh | 13 | ||||
-rw-r--r-- | include/ir_code.hh | 55 | ||||
-rw-r--r-- | include/loop.hh | 4 |
4 files changed, 35 insertions, 39 deletions
diff --git a/include/chillAST/chillAST_node.hh b/include/chillAST/chillAST_node.hh index 95480a4..0c92372 100644 --- a/include/chillAST/chillAST_node.hh +++ b/include/chillAST/chillAST_node.hh @@ -405,6 +405,8 @@ public: //! Public interface for fixing child info, which can be called from anynode. void fixChildInfo(); + + chillAST_Node* findContainingStmt(); }; diff --git a/include/ir_clang.hh b/include/ir_clang.hh index 9b9e4be..4344f68 100755 --- a/include/ir_clang.hh +++ b/include/ir_clang.hh @@ -224,22 +224,13 @@ struct IR_chillScalarRef : public IR_ScalarRef { struct IR_chillArrayRef : public IR_ArrayRef { - //DeclRefExpr *as_; - //chillAST_DeclRefExpr *chillDRE; chillAST_ArraySubscriptExpr *chillASE; int iswrite; - - // IR_chillArrayRef(const IR_Code *ir, DeclRefExpr *as, ParentMap *pMap = NULL) { - // ir_ = ir; - // fprintf(stderr, "new IR_chillArrayRef() CLANG ERROR\n"); exit(-1); - //} - IR_chillArrayRef(const IR_Code *ir, chillAST_ArraySubscriptExpr *ase, int write) { - //fprintf(stderr, "IR_chillArrayRef::IR_chillArrayRef() write %d\n", write); ir_ = ir; chillASE = ase; - iswrite = write; // ase->imwrittento; + iswrite = write; } bool is_write() const; @@ -492,6 +483,8 @@ public: IR_ArrayRef *CreateArrayRef(const IR_ArraySymbol *sym, std::vector<omega::CG_outputRepr *> &index); + virtual bool FromSameStmt(IR_ArrayRef *A, IR_ArrayRef *B); + int ArrayIndexStartAt() { return 0; } // TODO FORTRAN std::vector<IR_ScalarRef *> FindScalarRef(const omega::CG_outputRepr *repr) const; diff --git a/include/ir_code.hh b/include/ir_code.hh index 813fc0d..8de0f01 100644 --- a/include/ir_code.hh +++ b/include/ir_code.hh @@ -360,7 +360,7 @@ public: virtual IR_ScalarSymbol *CreateScalarSymbol(const IR_Symbol *sym, int memory_type) = 0; virtual IR_ScalarSymbol *CreateScalarSymbol(IR_CONSTANT_TYPE type, int memory_type, std::string name = "") { - fprintf(stderr, "ir_code.hh SOME SUBCLASS OF ir_code did not implement CreateArrayRefRepr()\n"); + CHILL_ERROR("NOT IMPLEMENTED\n"); return NULL; } @@ -370,26 +370,26 @@ public: virtual IR_ArraySymbol *CreateArraySymbol(omega::CG_outputRepr *type, std::vector<omega::CG_outputRepr *> &size_repr) { - fprintf(stderr, "ir_code.hh SOME SUBCLASS OF ir_code did not implement CreateArrayRefRepr()\n"); + CHILL_ERROR("NOT IMPLEMENTED\n"); return NULL; } virtual IR_PointerSymbol *CreatePointerSymbol(const IR_Symbol *sym, std::vector<omega::CG_outputRepr *> &size_repr) { - fprintf(stderr, "ir_code.hh SOME SUBCLASS OF ir_code did not implement CreateArrayRefRepr()\n"); + CHILL_ERROR("NOT IMPLEMENTED\n"); return NULL; } virtual IR_PointerSymbol *CreatePointerSymbol(const IR_CONSTANT_TYPE type, std::vector<omega::CG_outputRepr *> &size_repr, std::string name = "") { - fprintf(stderr, "ir_code.hh SOME SUBCLASS OF ir_code did not implement CreateArrayRefRepr()\n"); + CHILL_ERROR("NOT IMPLEMENTED\n"); return NULL; } virtual IR_PointerSymbol *CreatePointerSymbol(omega::CG_outputRepr *type, std::vector<omega::CG_outputRepr *> &size_repr) { - fprintf(stderr, "ir_code.hh SOME SUBCLASS OF ir_code did not implement CreateArrayRefRepr()\n"); + CHILL_ERROR("NOT IMPLEMENTED\n"); return NULL; } @@ -399,46 +399,46 @@ public: virtual omega::CG_outputRepr *CreateArrayRefRepr(const IR_ArraySymbol *sym, std::vector<omega::CG_outputRepr *> &index) { - fprintf(stderr, "ir_code.hh SOME SUBCLASS OF ir_code did not implement CreateArrayRefRepr()\n"); + CHILL_ERROR("NOT IMPLEMENTED\n"); return NULL; } virtual IR_PointerArrayRef *CreatePointerArrayRef(IR_PointerSymbol *sym, std::vector<omega::CG_outputRepr *> &index) { - fprintf(stderr, "ir_code.hh SOME SUBCLASS OF ir_code did not implement CreateArrayRefRepr()\n"); + CHILL_ERROR("NOT IMPLEMENTED\n"); return NULL; } virtual int ArrayIndexStartAt() { return 0; } virtual void CreateDefineMacro(std::string s, std::string args, omega::CG_outputRepr *repr) { - fprintf(stderr, "ir_code.hh SOME SUBCLASS OF ir_code did not implement CreateArrayRefRepr()\n"); + CHILL_ERROR("NOT IMPLEMENTED\n"); } virtual void CreateDefineMacro(std::string s, std::string args, std::string repr) { - fprintf(stderr, "ir_code.hh SOME SUBCLASS OF ir_code did not implement CreateArrayRefRepr()\n"); + CHILL_ERROR("NOT IMPLEMENTED\n"); } virtual void CreateDefineMacro(std::string s, std::vector<std::string> args, omega::CG_outputRepr *repr) {}; // TODO make pure virtual virtual omega::CG_outputRepr *CreateArrayType(IR_CONSTANT_TYPE type, omega::CG_outputRepr *size) { - fprintf(stderr, "ir_code.hh SOME SUBCLASS OF ir_code did not implement CreateArrayRefRepr()\n"); + CHILL_ERROR("NOT IMPLEMENTED\n"); return NULL; } virtual omega::CG_outputRepr *CreatePointerType(IR_CONSTANT_TYPE type) { - fprintf(stderr, "ir_code.hh SOME SUBCLASS OF ir_code did not implement CreateArrayRefRepr()\n"); + CHILL_ERROR("NOT IMPLEMENTED\n"); return NULL; } virtual omega::CG_outputRepr *CreatePointerType(omega::CG_outputRepr *type) { - fprintf(stderr, "ir_code.hh SOME SUBCLASS OF ir_code did not implement CreateArrayRefRepr()\n"); + CHILL_ERROR("NOT IMPLEMENTED\n"); return NULL; } virtual omega::CG_outputRepr *CreateScalarType(IR_CONSTANT_TYPE type) { - fprintf(stderr, "ir_code.hh SOME SUBCLASS OF ir_code did not implement CreateArrayRefRepr()\n"); + CHILL_ERROR("NOT IMPLEMENTED\n"); return NULL; } @@ -450,6 +450,7 @@ public: virtual std::vector<IR_PointerArrayRef *> FindPointerArrayRef(const omega::CG_outputRepr *repr) const { fprintf(stderr, "ir_code.hh SOME SUBCLASS OF ir_code did not implement CreateArrayRefRepr()\n"); + CHILL_ERROR("NOT IMPLEMENTED\n"); return std::vector<IR_PointerArrayRef *>(); } @@ -457,6 +458,7 @@ public: virtual bool parent_is_array(IR_ArrayRef *a) { fprintf(stderr, "ir_code.hh SOME SUBCLASS OF ir_code did not implement CreateArrayRefRepr()\n"); + CHILL_ERROR("NOT IMPLEMENTED\n"); return false; } @@ -471,7 +473,7 @@ public: virtual IR_Block *GetCode() const = 0; virtual IR_Control *GetCode(omega::CG_outputRepr *code) const { - fprintf(stderr, "ir_code.hh SOME SUBCLASS OF ir_code did not implement CreateArrayRefRepr()\n"); + CHILL_ERROR("NOT IMPLEMENTED\n"); return NULL; } @@ -488,66 +490,65 @@ public: virtual IR_Ref *Repr2Ref(const omega::CG_outputRepr *repr) const = 0; // Manu:: Added functions required for reduction operation - // virtual omega::CG_outputRepr * FromSameStmt(IR_ArrayRef *A, IR_ArrayRef *B) = 0; virtual bool FromSameStmt(IR_ArrayRef *A, IR_ArrayRef *B) { - fprintf(stderr, "ir_code.hh SOME SUBCLASS OF ir_code did not implement CreateArrayRefRepr()\n"); + CHILL_ERROR("NOT IMPLEMENTED\n"); return NULL; } virtual void printStmt(const omega::CG_outputRepr *repr) { - fprintf(stderr, "ir_code.hh SOME SUBCLASS OF ir_code did not implement CreateArrayRefRepr()\n"); + CHILL_ERROR("NOT IMPLEMENTED\n"); } virtual int getStmtType(const omega::CG_outputRepr *repr) { - fprintf(stderr, "ir_code.hh SOME SUBCLASS OF ir_code did not implement CreateArrayRefRepr()\n"); + CHILL_ERROR("NOT IMPLEMENTED\n"); return 0; } virtual IR_OPERATION_TYPE getReductionOp(const omega::CG_outputRepr *repr) { - fprintf(stderr, "ir_code.hh SOME SUBCLASS OF ir_code did not implement CreateArrayRefRepr()\n"); + CHILL_ERROR("NOT IMPLEMENTED\n"); return IR_OP_MINUS; } virtual IR_Control *FromForStmt(const omega::CG_outputRepr *repr) { - fprintf(stderr, "ir_code.hh SOME SUBCLASS OF ir_code did not implement CreateArrayRefRepr()\n"); + CHILL_ERROR("NOT IMPLEMENTED\n"); return NULL; } // Manu:: Added functions for scalar expansion virtual IR_ArraySymbol *CreateArraySymbol(omega::CG_outputRepr *size, const IR_Symbol *sym) { - fprintf(stderr, "ir_code.hh SOME SUBCLASS OF ir_code did not implement CreateArrayRefRepr()\n"); + CHILL_ERROR("NOT IMPLEMENTED\n"); return NULL; } virtual bool ReplaceRHSExpression(omega::CG_outputRepr *code, IR_Ref *ref) { - fprintf(stderr, "ir_code.hh SOME SUBCLASS OF ir_code did not implement CreateArrayRefRepr()\n"); + CHILL_ERROR("NOT IMPLEMENTED\n"); return NULL; } virtual omega::CG_outputRepr *GetRHSExpression(omega::CG_outputRepr *code) { - fprintf(stderr, "ir_code.hh SOME SUBCLASS OF ir_code did not implement CreateArrayRefRepr()\n"); + CHILL_ERROR("NOT IMPLEMENTED\n"); return NULL; } virtual omega::CG_outputRepr *GetLHSExpression(omega::CG_outputRepr *code) { - fprintf(stderr, "ir_code.hh SOME SUBCLASS OF ir_code did not implement CreateArrayRefRepr()\n"); + CHILL_ERROR("NOT IMPLEMENTED\n"); return NULL; } virtual omega::CG_outputRepr *CreateMalloc(const IR_CONSTANT_TYPE type, std::string lhs, omega::CG_outputRepr *size_repr) { - fprintf(stderr, "ir_code.hh SOME SUBCLASS OF ir_code did not implement CreateArrayRefRepr()\n"); + CHILL_ERROR("NOT IMPLEMENTED\n"); return NULL; } virtual omega::CG_outputRepr *CreateMalloc(omega::CG_outputRepr *type, std::string variable, omega::CG_outputRepr *size_repr) { - fprintf(stderr, "ir_code.hh SOME SUBCLASS OF ir_code did not implement CreateArrayRefRepr()\n"); + CHILL_ERROR("NOT IMPLEMENTED\n"); return NULL; } virtual omega::CG_outputRepr *CreateFree(omega::CG_outputRepr *exp) { - fprintf(stderr, "ir_code.hh SOME SUBCLASS OF ir_code did not implement CreateArrayRefRepr()\n"); + CHILL_ERROR("NOT IMPLEMENTED\n"); return NULL; } diff --git a/include/loop.hh b/include/loop.hh index 5af9975..554b005 100644 --- a/include/loop.hh +++ b/include/loop.hh @@ -117,12 +117,12 @@ public: Loop(const IR_Control *control); ~Loop(); - omega::CG_outputRepr *getCode(int effort = 3) const; // TODO was 1 + omega::CG_outputRepr *getCode(int effort = 1) const; // TODO was 1 //chillAST_Node* getCode(int effort, std::set<int> stmts) const; void stencilASEPadded(int stmt_num); - void printCode(int effort = 3) const; + void printCode(int effort = 1) const; void addKnown(const omega::Relation &cond); void print_internal_loop_structure() const; bool isInitialized() const; |