This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg] Vectorize PadTensorOp with conditional reads
Changes PlannedPublic

Authored by antiagainst on Jan 11 2022, 5:51 AM.

Details

Summary

This commits adds a pattern to vectorize linalg.pad_tensor
ops with static result shapes. It generates scf.if ops to
guard against vector.transfer_read ops to make sure they are
in bounds.

This is needed for correctness when the PadTensorOp has
dynamic low padding value. For such cases, we cannot simply
transfer the out-of-bound semantics to vector.transfer_read
ops by marking the corresponding dimensions' inbounds attribute
value to false, because vector.transfer_read ops assumes at
least the first value read along each dimension to be in bounds.

This pattern can also be helpful for eventually lowering to
hardware targets that does not have native support for
vector.transfer_write ops with out-of-bound semantics.

Depends On D117020

Diff Detail

Event Timeline

antiagainst created this revision.Jan 11 2022, 5:51 AM
antiagainst requested review of this revision.Jan 11 2022, 5:51 AM
mravishankar resigned from this revision.Feb 8 2022, 8:21 PM
mravishankar added a reviewer: springerm.
Herald added a project: Restricted Project. · View Herald TranscriptMar 12 2022, 8:31 AM
antiagainst planned changes to this revision.Sep 20 2022, 9:39 AM