This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Canonicalize AllocOp's with only store and dealloc uses
ClosedPublic

Authored by Hardcode84 on Apr 11 2021, 8:59 AM.

Diff Detail

Event Timeline

Hardcode84 created this revision.Apr 11 2021, 8:59 AM
Hardcode84 requested review of this revision.Apr 11 2021, 8:59 AM

clang-format

mehdi_amini accepted this revision.Apr 11 2021, 10:21 AM
mehdi_amini added inline comments.
mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
198–201
206

This loop could be llvm::any_of I think

This revision is now accepted and ready to land.Apr 11 2021, 10:21 AM

review comments

Hardcode84 marked 2 inline comments as done.Apr 11 2021, 10:55 AM
bondhugula requested changes to this revision.Apr 12 2021, 9:00 AM
bondhugula added a subscriber: bondhugula.
bondhugula added inline comments.
mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
198

Canonicalizatoin of alloc's that only had dealloc's was already supported. This is why the comment here mentioned "no uses" - because the SimplifyDeadDealloc would get rid of all deallocs if those had been the only things besides alloc's, and then the alloc's would have zero uses and disappear. You can remove the SimplifyDeadDealloc pattern now?

This revision now requires changes to proceed.Apr 12 2021, 9:00 AM
Hardcode84 added inline comments.Apr 12 2021, 9:16 AM
mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
198

SimplifyDeadDealloc already removed

I'm sorry this revision never showed up in my "Waiting for review" list for some reason. I did make multiple passes from time to time on my "waiting for my review", but didn't find this.

bondhugula accepted this revision.Apr 23 2021, 4:05 AM

LGTM. Please note the remaining minor comments.

mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
198

with only store and dealloc uses -> with no uses or only store and dealloc uses

?

209

auto -> Operation

This revision is now accepted and ready to land.Apr 23 2021, 4:05 AM

rebase, rewiew comments

bondhugula accepted this revision.Apr 23 2021, 10:02 PM