This is an archive of the discontinued LLVM Phabricator instance.

[mlir][transform] add a check for nested consumption in ApplyEachOpTrait
ClosedPublic

Authored by ftynse on Jun 9 2023, 2:53 AM.

Details

Summary

ApplyEachOpTrait applies to payload ops associated with its operand
handle one-by-one in order. If a handle is consumed, this usually
indicates that the associated payload ops are erased or rewritten. Add a
check that we don't consume an ancestor payload operation before
consuming its descendant, as the latter is likely to be a dangling
pointer. Transform operations for which this is a legitimate behavior
(i.e., they consume the handle but don't actually erase or rewrite the
payload operation) should implement the interface directly and allow for
repeated handles.

Diff Detail

Event Timeline

ftynse created this revision.Jun 9 2023, 2:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 9 2023, 2:53 AM
ftynse requested review of this revision.Jun 9 2023, 2:53 AM
springerm accepted this revision.Jun 9 2023, 3:20 AM
springerm added inline comments.
mlir/include/mlir/Dialect/Transform/IR/TransformInterfaces.h
1251

if

This revision is now accepted and ready to land.Jun 9 2023, 3:20 AM
ftynse marked an inline comment as done.Jun 9 2023, 3:43 AM