zxy844288792 opened a new pull request #8040:
URL: https://github.com/apache/tvm/pull/8040
If unused function presents like a cond branch never been accessed, memory
allocation pass will throw erros since it is not presented in context_analysis
map like errors shows below:
```
TVMError: Check failed: (it != context_analysis_map_.end()) is false: Cannot
find expr in the context analysis map:
E #[version = "0.0.5"]
E free_var %x2: Tensor[(2, 2), float32];
E %0 = fn (%p0: Tensor[(2, 2), float32], Primitive=1) ->
Tensor[(2, 2), float32] {
E multiply(%p0, 3f /* ty=float32 */) /* ty=Tensor[(2, 2),
float32] */
E };
E %0(%x2) /* ty=Tensor[(2, 2), float32] */
```
Add RemoveUnusedFunctions pass before memory allocation to avoid this issue.
Thanks for contributing to TVM! Please refer to guideline
https://tvm.apache.org/docs/contribute/ for useful information and tips. After
the pull request is submitted, please request code reviews from
[Reviewers](https://github.com/apache/incubator-tvm/blob/master/CONTRIBUTORS.md#reviewers)
by @ them in the pull request thread.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]