This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse][NFC] Use RewriterBase/OpBuilder when possible
ClosedPublic

Authored by springerm on May 12 2022, 6:11 AM.

Details

Summary

Most functions do not need a PatternRewriter or ConversionPatternRewriter.

Depends On D125361

Diff Detail

Event Timeline

springerm created this revision.May 12 2022, 6:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 12 2022, 6:11 AM
springerm requested review of this revision.May 12 2022, 6:11 AM

The dependent revisions are not needed. This is standalone.

aartbik accepted this revision.May 12 2022, 11:54 AM

Changes look good, and it is of course good to require the minimum required type. But is there a major advantage of doing it this way? (follow up or otherwise)?

This revision is now accepted and ready to land.May 12 2022, 11:54 AM

Changes look good, and it is of course good to require the minimum required type. But is there a major advantage of doing it this way? (follow up or otherwise)?

The API of One-Shot Bufferize provides a RewriterBase &, so this is needed in a few places to compose with the sparse compiler. Since I was already at it, I went through the entire sparsecompiler codebase and updated all PatternRewriter/ConversionPatternRewriter for consistency.