[TensorExpr] eliminate zero length Allocations in IRSimplifier (#38794)
Summary:
If the size of a temporary buffer is reduced to zero via binding of a dynamic variable we still run the alloc, even though it is a no op. It's easy to strip these out during simplification, so the expr:
```
{
Allocate(x, int, {0});
// Stuff...
Free(x);
}
```
becomes
```
{
// Stuff...
}
```
I am assuming here that if the allocation size is zero then any usage of the buffer is also eliminated since theres no safe way to refer to a zero size buffer.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/38794
Differential Revision: D21723656
Pulled By: nickgg
fbshipit-source-id: 3eaa8bd8974a13b0a351be04abe2348498b31b02