[TIRX] Expose analyzer-aware Python stmt/expr functors#19598
Open
tlopex wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces analyzer-aware versions of the Python StmtExprVisitor and StmtExprMutator within the tirx module. These new classes, PyStmtExprVisitorWithAnalyzer and PyStmtExprMutatorWithAnalyzer, integrate a C++-backed arith::Analyzer to automatically track arithmetic constraints from loops, branches, and assertions during IR traversal. Feedback points out a high-severity issue regarding the fragile reconstruction of the Python Analyzer object, which bypasses the constructor and may result in null C++ handles. Furthermore, an improvement was suggested in the C++ implementation to use std::make_shared for better memory management of constraint contexts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR exposes C++-backed analyzer-aware stmt/expr functors to Python.
It adds
PyStmtExprVisitorWithAnalyzerandPyStmtExprMutatorWithAnalyzer, allowing Python-side TIRX passes to accessself.analyzerduring traversal while preserving analyzer context across loops, blocks, branches, asserts, pure bindings,Select, andtirx.if_then_else.