[tensorexpr] Simplify x/100 -> 0 if x is a non-negative integer less than 100. (...
authorHui Guo <huiguo@fb.com>
Sat, 11 Sep 2021 03:30:06 +0000 (20:30 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Sat, 11 Sep 2021 03:33:02 +0000 (20:33 -0700)
commit4481c87ac408560cb03aa3c81d0dcc1a77acdd4c
tree7d62bdeca9bf443baccfa8eb6a2a3116c0def979
parent5836a116d0de214d6d759e70671f23150a5deaba
[tensorexpr] Simplify x/100 -> 0 if x is a non-negative integer less than 100. (#64763)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/64763

Simplification pattern:
  x/N -> 0; N is a constant positive integer and x is a for-loop index whose range is a subset of [0, N).

Test Plan: Imported from OSS

Reviewed By: bertmaher

Differential Revision: D30845854

Pulled By: huiguoo

fbshipit-source-id: 814d69ed4be05e57405c222183cc1c6c526721cd
test/cpp/tensorexpr/test_simplify.cpp
torch/csrc/jit/tensorexpr/ir_simplifier.cpp