This is an archive of the discontinued LLVM Phabricator instance.

[GlobalDCE] [VFE] Avoid dropping vfunc dependencies when an invalid vtable entry is present
ClosedPublic

Authored by kubamracek on Feb 16 2022, 9:24 PM.

Details

Summary

See the attached (pre-committed) test case. Looks like when we scan vtables for a particular vload in ScanVTableLoad and an entry in one possible vtable is invalid (null or non-fptr), we bail in a wrong way -- we completely stop the scanning of vtables with a return and this results in dropped dependencies because we don't perform GVDependencies[Caller].insert(Callee); on following valid vtable entries. Let's fix that.

Diff Detail

Event Timeline

kubamracek created this revision.Feb 16 2022, 9:24 PM
kubamracek requested review of this revision.Feb 16 2022, 9:24 PM
fhahn accepted this revision.Feb 17 2022, 11:03 AM

LGTM, thanks! It looks like the test only occurs the 'not function pointer' case. Could you also add a case covering the not a pointer case?

This revision is now accepted and ready to land.Feb 17 2022, 11:03 AM
This revision was landed with ongoing or failed builds.Feb 17 2022, 7:43 PM
This revision was automatically updated to reflect the committed changes.