This is an archive of the discontinued LLVM Phabricator instance.

add source lookup to bufferization canonicalization
DraftPublic

Authored by kushanam on Aug 1 2022, 2:00 PM.
This is a draft revision that has not yet been submitted for review.

Details

Reviewers
frgossen

Diff Detail

Event Timeline

kushanam created this revision.Aug 1 2022, 2:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 1 2022, 2:00 PM

Nice! I think this is going in the direction that fixes our deallocation issue.

mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp
453–455

You are essentially addressing this comment. I think this might also be the best place to walk up the chain of aliases as the deallocs are found below.

471

Did you do this?

"conform to the LLVM Coding Standards. You can use the clang-format-diff.py or git-clang-format tools to automatically format your patch properly." (see https://llvm.org/docs/Contributing.html#how-to-submit-a-patch)

472

This will give you the preceding op, not the definition of the operand. You are probably looking for something like cloneOp.getInput().getDefiningoperation().

mlir/test/Dialect/Bufferization/canonicalize.mlir
260

You want to add a // CHECK-LABEL: @Atanh_platform_elem_type_output_type here.

271

Please add a // CHECK return {{.*}} here to make clear beween which ops you want to check the absence of clone and dealloc.
Othweise, this will consider the following lines until the next check (or file end in this case), which can be confusing when adding more tests cases.

kushanam updated this revision to Diff 449414.Aug 2 2022, 1:46 PM
kushanam removed a project: Restricted Project.
kushanam removed subscribers: mehdi_amini, rriddle, shauheen and 18 others.

Applying review changes

Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2022, 1:46 PM

This diff looks a bit odd, like it is not relative to the original code. You might want to read these.

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

Missing :