This is an archive of the discontinued LLVM Phabricator instance.

[mlir][tensor] Allow tensors with zero dims in tensor.pad/extract_slice swapping
Needs ReviewPublic

Authored by springerm on Jul 24 2023, 11:44 AM.

Details

Reviewers
nicolasvasilache
Summary

The tensor.pad(tensor.extract_slice) swapping pattern used to generate "scf.if" and "tensor.generate" ops to avoid tensors that have a dimension that has a static or dynamic size zero. This revision removes that functionality. Tensors with a static dimension zero size may appear in the resulting IR. Such IR can be bufferized and is ignored by vectorization. Ops involving tensors that have zero elements usually fold away at some point.

Depends On: D156137

Diff Detail