This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Don't inline calls from dead SCCs
ClosedPublic

Authored by ftynse on Jan 7 2022, 10:07 AM.

Details

Summary

During iterative inlining of the functions in a multi-step call chain, the
inliner could add the same call operation several times to the worklist, which
led to use-after-free when this op was considered more than once.

Closes #52887.

Diff Detail

Event Timeline

ftynse created this revision.Jan 7 2022, 10:07 AM
ftynse requested review of this revision.Jan 7 2022, 10:07 AM
ftynse edited the summary of this revision. (Show Details)Jan 7 2022, 10:07 AM
wsmoses added inline comments.Jan 7 2022, 10:25 AM
mlir/lib/Transforms/Inliner.cpp
461

Could this be changed to a set vector to avoid an O(N) check on this line?

wsmoses accepted this revision.Jan 7 2022, 1:53 PM

LGTM with a change to setvector.

This revision is now accepted and ready to land.Jan 7 2022, 1:53 PM
ftynse updated this revision to Diff 398548.Jan 10 2022, 2:39 AM

Use SmallSetVector.

This revision was automatically updated to reflect the committed changes.