Fix bug when an index appears in two expressions (#104886)
We were not adding the bounds to `replacement_vars` in this case.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/104886
Approved by: https://github.com/eellison, https://github.com/Skylion007