This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg] Promote operands for convolution vectorization
ClosedPublic

Authored by antiagainst on Apr 16 2023, 8:55 AM.

Details

Summary

We are already doing this for depthwise convolution and pooling.
This helps to preserve the promotion semantics from Linalg op
definitions to lower layers.

Along the way, fixed the type mismatch issue in the existing
promote implementation.

Diff Detail

Event Timeline

antiagainst created this revision.Apr 16 2023, 8:55 AM
Herald added a project: Restricted Project. · View Herald Transcript
antiagainst requested review of this revision.Apr 16 2023, 8:55 AM
kuhar accepted this revision.Apr 17 2023, 7:09 AM

LGTM

mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
2522–2523

nit: This function doesn't seem to require ints and floats as the only element types until the assertion at the very bottom -- should we assert the element type is int or float before we query the bit width? As is, I think this would assert somewhere inside getIntOrFloatBitWidth.

2524

nit: use free cast functions. Also for the isas below.

This revision is now accepted and ready to land.Apr 17 2023, 7:09 AM
This revision was automatically updated to reflect the committed changes.
antiagainst marked 2 inline comments as done.