Page MenuHomePhabricator

[mlir] Linalg: Extend promotion to non f32 buffers.
ClosedPublic

Authored by poechsel on Thu, Feb 13, 1:45 AM.

Details

Summary

Linalg's promotion pass was only supporting f32 buffers due to how the
zero value was build for the fill operation.

Moreover, promoteSubViewOperands was returning a vector with one entry
per float subview while omitting integer subviews. For a program
with only integer subviews the return vector would be of size 0.
However, promoteSubViewsOperands would try to access a non zero
number of entries of this vector, resulting in a sefgault.

Diff Detail

Event Timeline

poechsel created this revision.Thu, Feb 13, 1:45 AM
rriddle added inline comments.Thu, Feb 13, 11:17 AM
mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp
136

Remove trivial braces.

221–222

sv.getType().getElementType().isIntOrFloat()

poechsel updated this revision to Diff 244581.Fri, Feb 14, 12:53 AM
poechsel marked 2 inline comments as done.

Reformat the code.

ftynse accepted this revision.Fri, Feb 14, 1:43 AM

I wonder how much of the test here is just carried over mechanically and if we could do something to reduce this churn...

This revision is now accepted and ready to land.Fri, Feb 14, 1:43 AM
This revision was automatically updated to reflect the committed changes.