junrushao1994 commented on a change in pull request #10843:
URL: https://github.com/apache/tvm/pull/10843#discussion_r840144862
##########
File path: include/tvm/tir/stmt_functor.h
##########
@@ -413,6 +413,16 @@ inline T Substitute(T input, const
std::unordered_map<const VarNode*, PrimExpr>&
*/
TVM_DLL void PreOrderVisit(const ObjectRef& stmt_or_expr,
const std::function<bool(const ObjectRef&)>&
fvisit);
+
+class PrimFunc;
+/*!
+ * \brief Re-generate the definition nodes for a TIR, including VarDef,
BufferDef.
+ * This pass works as a simple DeepCopy to duplicate a function with
different Vars and
+ * Buffers but the same behavior
+ * \param func The input PrimFunc.
+ * \return The new generated func.
+ */
+TVM_DLL PrimFunc ReGenerateDef(const PrimFunc& func);
Review comment:
I found the name `ReGenerateDef` very confusion for two reasons:
- ReGenerate usually means adding new things, while we are replacing
variables;
- Def doesn't refer to specific definition...Without reading the comments,
it's non-trivial to figure out what "def" are we regenerating...
I can quickly come up with a few alternatives, but have to admit i'm not
good at naming...
* RenewVarBufferDef
* UpdateVarBufferDef
* SubstituteVarBufferDef
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]