This is an archive of the discontinued LLVM Phabricator instance.

[LTO/WPD] Allow devirtualization to function alias in vtable
ClosedPublic

Authored by tejohnson on Feb 17 2023, 7:58 AM.

Details

Summary

Follow on to D144209 to support single implementation devirtualization
for Regular LTO when the vtable holds a function alias.

For now I have prevented other optimizations performed in regular LTO
that need to analyze the contents of the function target when the vtable
holds an alias, as I'm not sure they are always correct to perform in
that case.

Diff Detail

Event Timeline

tejohnson created this revision.Feb 17 2023, 7:58 AM
tejohnson requested review of this revision.Feb 17 2023, 7:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 17 2023, 7:58 AM
mingmingl accepted this revision.Feb 17 2023, 11:16 AM

The change to handle function alias for single-impl-devirt LGTM. The current way of bailing-out-upon-function-alias where function is assumed (e.g., virtual const propagation) sounds reasonable (since function-aliases are not handled correctly).

Maybe wait a little bit more for people with more experience in other optimizations that need to analyze function content to chime in; if no concerns we can land this.

This revision is now accepted and ready to land.Feb 17 2023, 11:16 AM
This revision was landed with ongoing or failed builds.Feb 23 2023, 2:04 PM
This revision was automatically updated to reflect the committed changes.