This is an archive of the discontinued LLVM Phabricator instance.

[NFC][FuncSpec] Add a test to show redundant function cloning.
ClosedPublic

Authored by labrinea on Oct 7 2022, 10:10 AM.

Details

Summary

This happens when we find identical specializations. Despite the call site pointing to the right clone, we do emit a dead copy (compute.3 in this example).

Diff Detail

Event Timeline

labrinea created this revision.Oct 7 2022, 10:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 7 2022, 10:10 AM
labrinea requested review of this revision.Oct 7 2022, 10:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 7 2022, 10:10 AM
chill accepted this revision.Oct 10 2022, 3:52 AM
chill added inline comments.
llvm/test/Transforms/FunctionSpecialization/identical-specializations.ll
3

Don't we avoid old PM syntax in new tests?

This revision is now accepted and ready to land.Oct 10 2022, 3:52 AM
labrinea updated this revision to Diff 467061.Oct 12 2022, 2:01 AM

Chages from last revision:

  • used the command line option syntax of the new pass manager
  • added a recursive call to demonstrate the issue found in D135463

But the same ought to happen for:

void g(int x, int y) { ... g(x, 2); ... }
...
g(1, 2);