Lunderberg commented on code in PR #15954:
URL: https://github.com/apache/tvm/pull/15954#discussion_r1426897693
##########
src/ir/transform.cc:
##########
@@ -531,6 +531,23 @@ Pass CreateModulePass(const
runtime::TypedPackedFunc<IRModule(IRModule, PassCont
return ModulePass(pass_func, pass_info);
}
+Pass ApplyPassToFunction(Pass pass, String func_name, bool
error_if_function_missing) {
Review Comment:
I think that would work, but only in the case where
`error_if_function_missing = false`. If there's a `List[String]`, then it
wouldn't be clear to a reader whether an error is raised when all of the listed
functions are absent, or when any of the listed functions are absent.
I've been picturing this utility as being useful for hand-crafted
optimization pipelines, where some optimizations should only be applied to
specific functions. In those cases, raising an error when an expected function
is missing would allow for earlier detection of an invalid optimization
pipeline.
--
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]