This is an archive of the discontinued LLVM Phabricator instance.

[flang][hlfir] use adaptor in associate bufferization
ClosedPublic

Authored by tblah on Jul 7 2023, 6:35 AM.

Details

Summary

The associate operation checks if it is the only use of the hlfir.expr,
and if so it can take ownership of the hlfir.expr instead of copying it
(move semantics).

If this check is done by accessing the associate operation's arguments
directly (not through the AssociateOpAdaptor), the expression uses will
contain some operations which have been deleted. These can include prior
copies of the same associate operation, if that operation was cloned
(e.g. to lower a hlfir.elemental into a fir.do_loop). Accessing the
bufferized expression instead of the old hlfir.expr through the adaptor
avoids this false positive.

Diff Detail