This is an archive of the discontinued LLVM Phabricator instance.

[clang] Ensure correct metadata for relative vtables
ClosedPublic

Authored by leonardchan on Sep 26 2022, 5:54 PM.

Details

Summary

Prior to this, metadata pertaining to the size or address point offsets into a relative vtable were twice the value they should be (treating component widths as pointer width rather than 4 bytes). This prevented some vtables from being devirtualized with D134320. This ensures the correct metadata is written so whole program devirtualization can catch these remaining devirt targets.

Diff Detail

Event Timeline

leonardchan created this revision.Sep 26 2022, 5:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 26 2022, 5:54 PM
Herald added a subscriber: Prazek. · View Herald Transcript
leonardchan requested review of this revision.Sep 26 2022, 5:54 PM
phosek added inline comments.Sep 27 2022, 2:49 PM
clang/lib/CodeGen/CGVTables.cpp
1291–1293

Could we use getVTableComponentType method here?

leonardchan marked an inline comment as done.
This revision is now accepted and ready to land.Nov 19 2022, 3:21 PM
This revision was landed with ongoing or failed builds.Dec 7 2022, 4:43 PM
This revision was automatically updated to reflect the committed changes.