This is an archive of the discontinued LLVM Phabricator instance.

add dealloc alias check to bufferization
AbandonedPublic

Authored by kushanam on Aug 3 2022, 3:24 PM.

Details

Reviewers
frgossen

Diff Detail

Event Timeline

kushanam created this revision.Aug 3 2022, 3:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2022, 3:24 PM
kushanam requested review of this revision.Aug 3 2022, 3:24 PM
frgossen requested changes to this revision.Aug 4 2022, 7:20 AM
frgossen added inline comments.
mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp
456

is currently unused

460–469

Starting with if (isa<memref::..., I think this can still be the old logic. The loop above is all you need, I think.

mlir/test/Dialect/Bufferization/canonicalize.mlir
258–273

Can you add the // ----- between the test cases?

260

Can you give the test function a meaningful name?

262

This could be passed in as an arg to keep the test simpler.

This revision now requires changes to proceed.Aug 4 2022, 7:20 AM
kushanam updated this revision to Diff 450118.Aug 4 2022, 1:25 PM

Add dealloc alias check to bufferization
Traverse the cloneOp for aliases to find the alloc op

frgossen requested changes to this revision.Aug 4 2022, 2:46 PM
frgossen added inline comments.
mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp
457

How about only updateing the above source value/op here and using the previous implementation with the maybeSourceDeallocOp?
That would make this patch very simple to understand if we break something.

This revision now requires changes to proceed.Aug 4 2022, 2:46 PM
kushanam updated this revision to Diff 450197.Aug 4 2022, 5:54 PM

add dealloc alias check to bufferization
Traverse the cloneOp for aliases to find the alloc op

kushanam updated this revision to Diff 450323.Aug 5 2022, 10:38 AM

Add dealloc alias check to bufferization
Traverse the cloneOp for aliases to find the alloc op

Nice!

Now the test cases:

Failed Tests (3):
  MLIR :: Dialect/Bufferization/canonicalize.mlir
  MLIR :: Dialect/Bufferization/inlining.mlir
  MLIR :: Transforms/canonicalize.mlir
mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp
455

LLVM naming convention wants it to be named sourceOp.

nit: source.getDefiningOp()

kushanam abandoned this revision.Aug 11 2022, 4:37 PM

Moved to D131740