This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg][bufferize] Add dialect filter to BufferizationOptions
ClosedPublic

Authored by springerm on Nov 28 2021, 11:40 PM.

Details

Summary

This change adds a new option dialectFilter to BufferizationOptions. Only ops from dialects that are allow-listed in the filter are bufferized. Other ops are left unbufferized. Note: This option requires allowUnknownOps = true.

To make use of dialectFilter, BufferizationOptions or BufferizationState must be passed to various helper functions.

The purpose of this change is to provide a better infrastructure for partial bufferization, which will be fully activated in a subsequent change.

Depends On D114671

Diff Detail

Event Timeline

springerm created this revision.Nov 28 2021, 11:40 PM
springerm requested review of this revision.Nov 28 2021, 11:40 PM
nicolasvasilache requested changes to this revision.Dec 1 2021, 12:39 AM

Please move this to test passes, similar to the parent commit.
Once this is more fleshed out they can replace the existing "partial" bufferization passes (and shoule be renamed to partial at that point).

This revision now requires changes to proceed.Dec 1 2021, 12:39 AM
springerm updated this revision to Diff 392294.Dec 7 2021, 12:01 AM

address comments

springerm updated this revision to Diff 392644.Dec 7 2021, 9:57 PM

add test case

springerm retitled this revision from [mlir][linalg][bufferize] Add tensor / vector bufferization passes to [mlir][linalg][bufferize] Add dialect filter to BufferizationOptions.Dec 7 2021, 10:01 PM
springerm edited the summary of this revision. (Show Details)
rriddle added inline comments.Dec 7 2021, 10:06 PM
mlir/include/mlir/Dialect/Linalg/ComprehensiveBufferize/BufferizableOpInterface.h
97

I've always found AllowListed to be an awkward mouthful, why not just isOpAllowed/isOpSupported/etc.

98–100
mlir/lib/Dialect/Linalg/ComprehensiveBufferize/TensorInterfaceImpl.cpp
203

Leftover debugging here.

nicolasvasilache accepted this revision.Dec 8 2021, 12:06 AM
This revision is now accepted and ready to land.Dec 8 2021, 12:06 AM
springerm updated this revision to Diff 392743.Dec 8 2021, 6:26 AM
springerm marked 2 inline comments as done.

update

This revision was landed with ongoing or failed builds.Dec 8 2021, 6:51 AM
This revision was automatically updated to reflect the committed changes.
springerm marked an inline comment as done.Dec 8 2021, 6:55 AM