[TensorExpr] add Block flattening to IR Simplifier (#37013)
Summary:
Some IR optimizations were leaving superfluous Blocks in the IR, this PR adds simplification and merging of enclosing Block statements to the IR Simplifier, e.g.
```
Block {
Stmt 1
Block {
Stmt 2
}
Block {}
}
```
becomes
```
Block {
Stmt 1
Stmt 2
}
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/37013
Differential Revision: D21166208
Pulled By: nickgg
fbshipit-source-id: 6dcdf863980d94731a8ddf184882c4a5b7259381