This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Utility method for getting mixed integer and values list as just values.
AbandonedPublic

Authored by mravishankar on Mar 1 2021, 10:45 AM.

Details

Summary

For a list of mixed integer and SSA values (used for offsets, sizes
and strides in OffsetSizeAndStrideOpInterface) return the entries as
SSA values.

Diff Detail

Event Timeline

mravishankar created this revision.Mar 1 2021, 10:45 AM
mravishankar requested review of this revision.Mar 1 2021, 10:45 AM
hanchung accepted this revision.Mar 2 2021, 11:20 AM

just few style nits.

mlir/include/mlir/Interfaces/ViewLikeInterface.td
183

Add a period at the end.

218

ditto

253

ditto

mlir/lib/Interfaces/ViewLikeInterface.cpp
11–12

Add a blank line between these two.

44–45

Add a blank line between two methods.

This revision is now accepted and ready to land.Mar 2 2021, 11:20 AM

Address comments and use ValueRange instead OperandRange for values.

mravishankar marked 5 inline comments as done.Mar 2 2021, 12:47 PM

Moving the utility methods to StandardDialect/Utils since keep it on
ViewInterface is a layering violation. Also drop the interface methods
that use that utility.

rriddle added inline comments.Mar 2 2021, 2:00 PM
mlir/lib/Dialect/StandardOps/Utils/Utils.cpp
36 ↗(On Diff #327576)

Can you use integers.getAsValueRange<IntegerAttr>() instead?

39 ↗(On Diff #327576)

nit: Drop trivial braces.

mravishankar marked an inline comment as done.

Address comments

mlir/lib/Dialect/StandardOps/Utils/Utils.cpp
36 ↗(On Diff #327576)

Thanks!

mravishankar abandoned this revision.Mar 3 2021, 1:59 PM

@nicolasvasilache suggestion abandoning this patch. The intent is to make the use of OpFoldResult more common, and having a fall back to get Value would affect that.