This is an archive of the discontinued LLVM Phabricator instance.

[LazyCallGraph] Update libcall list when replacing a libcall node's function
ClosedPublic

Authored by aeubanks on Aug 26 2022, 3:10 PM.

Details

Summary

Otherwise when we visit all libcalls in
updateCGAndAnalysisManagerForPass(), the old libcall is dead and doesn't
have a node.

We treat libcalls conservatively in LazyCallGraph because any function
may introduce calls to them out of thin air.

It is weird to change the signature of a libcall since introducing calls
to the libcall with a different signature may break, but other passes
like deadargelim already do it, so let's preserve this behavior for now.

Fixes an issue found in D128830.

Diff Detail

Event Timeline

aeubanks created this revision.Aug 26 2022, 3:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 26 2022, 3:10 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
aeubanks requested review of this revision.Aug 26 2022, 3:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 26 2022, 3:10 PM
psamolysov accepted this revision.EditedAug 27 2022, 12:01 AM

@aeubanks Thank you very much for the fix! I tried the cases described in D128830 and to run the new test Analysis/LazyCallGraph/replace-libcall.ll. On my environment, everything works fine, so I accept the revision.

This revision is now accepted and ready to land.Aug 27 2022, 12:01 AM
This revision was landed with ongoing or failed builds.Aug 27 2022, 11:08 AM
This revision was automatically updated to reflect the committed changes.