This is an archive of the discontinued LLVM Phabricator instance.

add dealloc alias check to bufferization
AbandonedPublic

Authored by kushanam on Aug 11 2022, 4:36 PM.

Details

Reviewers
frgossen
Summary

Traverse the cloneOp for aliases to find the alloc op

Diff Detail

Event Timeline

kushanam created this revision.Aug 11 2022, 4:36 PM
kushanam requested review of this revision.Aug 11 2022, 4:36 PM

Nice! Thank you!

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

LLVM coding style is sourceOp. Please fix the other variable names also.

Maybe a better name here is allocOp, which is what you're trying to find.

455

Instead of cloneOp.getInput() you can reuse source from above

456–457

What if it is an alias of an argument, e.g. (reshape(%buffer_arg)), then you will run into a nullptr here.

You can use dyn_cast_or_null. Then the surrounding if statement is not needed also.

465

This is a canonicalSource, possibly the allocation value.

kushanam abandoned this revision.Aug 12 2022, 11:33 AM
This comment was removed by kushanam.