Conversation
| } | ||
|
|
||
| bool operator() (const Node* const& a, const Node* const& b) const { | ||
| return a == b || a && b && *a == *b; |
There was a problem hiding this comment.
Add parentheses around a && b && *a == *b to suppress Clang warning.
| namespace std { | ||
|
|
||
| template <typename T> | ||
| struct hash<simit::util::IntrusivePtr<T>> { |
There was a problem hiding this comment.
Is this actually used anywhere?
| } else { | ||
| newStmts.resize(std::remove_if(newStmts.begin(), newStmts.end(), | ||
| [](Stmt s){return !s.defined();}) - newStmts.begin()); | ||
| if (newStmts.size()) { |
There was a problem hiding this comment.
Use !newStmts.empty() instead.
| return e->type.isTensor(); | ||
| }; | ||
|
|
||
| if (PatternMatch<IndexedTensor(VarExpr)>::match( |
There was a problem hiding this comment.
Add comment to clarify what pattern is the code looking for here.
| return e->type.isTensor(); | ||
| }; | ||
|
|
||
| if (PatternMatch<AssignStmt(IndexExpr(IndexedTensor(VarExpr)))>::match |
There was a problem hiding this comment.
Add comment to clarify what patterns is the code looking for here.
| }\ | ||
| \ | ||
| template <typename ExprOrStmt, typename Callback>\ | ||
| static bool match(ExprOrStmt expr, const std::tuple<Callback>& callbacks) {\ |
There was a problem hiding this comment.
Might be better if callbacks is just of type Callback rather than a tuple.
| return !isSystemTensorType(type); | ||
| } | ||
|
|
||
| inline bool isFixedSizeTensor(Type type) { |
There was a problem hiding this comment.
This should probably be consolidated with isElementTensorType (they should be equivalent).
| simit::ir::Func rewrite(simit::ir::Func func); | ||
| }; | ||
|
|
||
| simit::ir::Func program_analysis(simit::ir::Func func); |
There was a problem hiding this comment.
Function name should use (lower) camel case.
| virtual Stmt rewrite(Stmt stmt); | ||
| virtual Func rewrite(Func func); | ||
|
|
||
| void enable(); |
There was a problem hiding this comment.
Should document purpose of enable and disable.
| return visitor.result; | ||
| } | ||
|
|
||
| Func CSE::rewrite(Func func) { |
There was a problem hiding this comment.
Why is this named CSE? Isn't this pass doing copy propagation?
No description provided.