tqchen opened a new pull request, #19502: URL: https://github.com/apache/tvm/pull/19502
## Summary The TIR CSE pass currently lifts bool-typed sub-expressions like `i < n` or `a && b` into `cse_v: bool = ...` bindings whenever they appear twice. Boolean expressions are almost always predicates feeding `if` / `Select` / `assert`, where reading the condition inline is clearer than going through a boolean temporary, and where downstream simplification (ProveCondition, branch elimination) benefits from seeing the predicate directly. - Extend `CSEPlanner::IsEligible` in `src/tirx/transform/common_subexpr_elim.cc` to reject any compound expression whose result dtype is `bool`. - Update the file-level `Eligibility rules` doc-comment and the per-function `IsEligible` docstring to document the new rule. - Add two regression tests (`test_no_lift_bool_predicate`, `test_no_lift_bool_logical`) covering comparison predicates and logical-And predicates respectively. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
