[inductor] Fix a perf regression caused by https://github.com/pytorch/pytorch/pull/98214 (#98343)
Summary: See the description in https://github.com/pytorch/pytorch/issues/98342
Pull Request resolved: https://github.com/pytorch/pytorch/pull/98343
Approved by: https://github.com/jansel