Lunderberg opened a new pull request, #16828: URL: https://github.com/apache/tvm/pull/16828
This resolves a bug that was introduced in https://github.com/apache/tvm/pull/16732. If a rewriter function returned a no-op, and the pattern-match continued, then the `matches` provided to the rewriter function in subsequent calls would contain a variable to which the matched expression was bound, not the matched expression itself. (e.g. For a match of `C = R.add(A,B)`, passing `C` to the rewriter instead of `R.add(A,B)`.) This bug was caused by incorrect re-wrapping of `OrPattern` in `ExprPatternRewriter`. Prior to https://github.com/apache/tvm/pull/16732, all pattern-match results were populated by `ExtractMatchExpr`, and contained the result after applying `TryGetValOfVar`. When re-wrapping the result of an `OrPattern`, https://github.com/apache/tvm/pull/16732 populated the additional matches with the result before applying `TryGetValOfVar`. This commit fixes the bug by applying `TryGetValOfVar`. -- 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]
