This is an archive of the discontinued LLVM Phabricator instance.

[FuncSpec] Relax restrictions on candidates for specialisation
ClosedPublic

Authored by chill on Apr 14 2023, 7:50 AM.

Details

Summary

Allow a function to be specialised even if it has its address taken or
it's global. For such functions, consider all of the arguments as
overdefined. Don't delete the functions even if all the apparent calls
were redirected to specialised instances.

Diff Detail

Event Timeline

chill created this revision.Apr 14 2023, 7:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 14 2023, 7:50 AM
chill requested review of this revision.Apr 14 2023, 7:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 14 2023, 7:50 AM
chill updated this revision to Diff 513604.Apr 14 2023, 8:22 AM
ChuanqiXu accepted this revision.Apr 14 2023, 9:13 PM
This revision is now accepted and ready to land.Apr 14 2023, 9:13 PM
labrinea accepted this revision.Apr 16 2023, 12:11 PM

I've checked the number of specializations created for CTMark with this patch. No changes there so I am not expecting a compile time hit. Approved.

nikic added a subscriber: nikic.Apr 20 2023, 5:16 AM

I've checked the number of specializations created for CTMark with this patch. No changes there so I am not expecting a compile time hit. Approved.

Looks like this assumption wasn't right. There is a compile-time regression (http://llvm-compile-time-tracker.com/compare.php?from=99d4c722e30816aca6698e20345bffab953d9d79&to=cc7bb7080fc8e6f4d217e7f9b971fbdbf091f9e7&stat=instructions:u) and code size changed on lencod (http://llvm-compile-time-tracker.com/compare.php?from=99d4c722e30816aca6698e20345bffab953d9d79&to=cc7bb7080fc8e6f4d217e7f9b971fbdbf091f9e7&stat=size-text).

I've checked the number of specializations created for CTMark with this patch. No changes there so I am not expecting a compile time hit. Approved.

Looks like this assumption wasn't right. There is a compile-time regression (http://llvm-compile-time-tracker.com/compare.php?from=99d4c722e30816aca6698e20345bffab953d9d79&to=cc7bb7080fc8e6f4d217e7f9b971fbdbf091f9e7&stat=instructions:u) and code size changed on lencod (http://llvm-compile-time-tracker.com/compare.php?from=99d4c722e30816aca6698e20345bffab953d9d79&to=cc7bb7080fc8e6f4d217e7f9b971fbdbf091f9e7&stat=size-text).

Right I see now. The compile time regression are without LTO, whereas I had checked only the LTO configuration. I can see three new specializations in lencod.