This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Inliner] Properly handle callgraph node deletion
ClosedPublic

Authored by rriddle on Jun 16 2020, 6:30 PM.

Details

Summary

We previously weren't properly updating the SCC iterator when nodes were removed, leading to asan failures in certain situations. This commit adds a CallGraphSCC class and defers operation deletion until inlining has finished.

Diff Detail

Event Timeline

rriddle created this revision.Jun 16 2020, 6:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 16 2020, 6:30 PM
jpienaar accepted this revision.Jun 16 2020, 7:46 PM
jpienaar marked an inline comment as done.

Nice, thanks for finding and fixing this!

mlir/lib/Transforms/Inliner.cpp
378

Is there a requirement on when this may be called? Or not really due to the helper class?

594

Would these just be "newly dead" ones or also ones that were dead before any inlinining? (E.g., does this overlap with symboldce?)

This revision is now accepted and ready to land.Jun 16 2020, 7:46 PM
rriddle marked 2 inline comments as done.Jun 17 2020, 1:08 PM
rriddle added inline comments.
mlir/lib/Transforms/Inliner.cpp
594

Yes, It includes those that are already dead, because it is "free" to detect when inlining.

This revision was automatically updated to reflect the committed changes.
rriddle marked an inline comment as done.