gigiblender opened a new pull request, #19584: URL: https://github.com/apache/tvm/pull/19584
`CollectDirectComparisons` and `DFSFromLHS` previously linear-scanned the unbounded `knowns_` vector on every `TryCompare` call. When `Simplify` walks many For nodes, this is O(N^2) in the number of For visits and produces an order-of-magnitude slowdown on large IR. Replace `knowns_` with `knowns_by_key_`, a map keyed by Key. Each Comparison is stored under both its keys (or once when they match). CollectDirectComparisons walks only the smaller of the two query-key buckets; DFSFromLHS walks only the bucket for the current expansion key. scoped_knowns_ stays a flat vector because its scope-exit truncation would require extra bookkeeping to keep in sync. Add `Comparison::operator==` for index cleanup on Bind override, split AddKnown into AddKnown / AddScopedKnown, and add `tests/python/arith/test_arith_transitive_comparison.py`. -- 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]
