[TensorExpr] Fix elimination of For loops with empty bodies (#38883)
Summary:
We do try to eliminate empty For loops, but missed a case where the body Block exists but is empty. In that case we can eliminate the loop as well.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/38883
Differential Revision: D21723680
Pulled By: nickgg
fbshipit-source-id: 49610b0524af5b9ec30ef3b4cc0c8461838259c3