[inductor] Pre-populate cache for simplify_with_ranges return value (#146373)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/146373
Approved by: https://github.com/yanboliang, https://github.com/shunting314
ghstack dependencies: #146252, #146254, #146255, #146257, #146282, #146297
This commit is contained in:
Jason Ansel 2025-02-07 13:32:55 -08:00 committed by PyTorch MergeBot
parent c098385cb3
commit eee5622b98

View File

@ -99,6 +99,8 @@ class SizeVarAllocator:
if result is None:
result = self._simplify_with_ranges(expr, var_ranges)
cache[key] = result
if result != expr:
cache[(result, *var_ranges.items())] = result
return result
return simplify_with_ranges