This is an archive of the discontinued LLVM Phabricator instance.

[mlir][bufferization] Generalize getAliasingOpResults to getAliasingValues
ClosedPublic

Authored by springerm on Aug 15 2023, 2:29 AM.

Details

Summary

This revision is needed to support bufferization of cf.br/cf.cond_br. It will also be useful for better analysis of loop ops.

This revision generalizes getAliasingOpResults to getAliasingValues. An OpOperand can now not only alias with OpResults but also with BlockArguments. In the case of cf.br (will be added in a later revision): a cf.br operand will alias with the corresponding argument of the destination block.

If an op does not implement the BufferizableOpInterface, the analysis in conservative. It previously assumed that an OpOperand may alias with each OpResult. It now assumes that an OpOperand may alias with each OpResult and each BlockArgument of the entry block.

Depends On: D157893

Diff Detail

Event Timeline

springerm created this revision.Aug 15 2023, 2:29 AM
Herald added a reviewer: aartbik. · View Herald Transcript
Herald added a reviewer: kuhar. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
springerm requested review of this revision.Aug 15 2023, 2:29 AM
maerhart accepted this revision.Aug 15 2023, 4:17 AM
maerhart added inline comments.
mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.td
32

"that"?

227

"Values"

mlir/lib/Dialect/Bufferization/IR/BufferizableOpInterface.cpp
1059

Shouldn't we also assume each block argument of each successor may also alias (also in above function)? Or are you planning to add this in a follow-up revision?

This revision is now accepted and ready to land.Aug 15 2023, 4:17 AM
This revision was automatically updated to reflect the committed changes.
springerm marked 3 inline comments as done.
springerm added inline comments.Aug 15 2023, 6:15 AM
mlir/lib/Dialect/Bufferization/IR/BufferizableOpInterface.cpp
1059

I'm going to add that in a subsequent change.