This is an archive of the discontinued LLVM Phabricator instance.

[MergeFunc] Allow merging identical vararg functions using aliases
ClosedPublic

Authored by vsk on Jan 17 2019, 10:10 AM.

Details

Summary

Thanks to Nikita Popov for pointing out this missed case.

This is a follow-up to r351411, which disabled function merging for
vararg functions outright due to a miscompile (see llvm.org/PR40345).

Diff Detail

Repository
rL LLVM

Event Timeline

vsk created this revision.Jan 17 2019, 10:10 AM
rnk added a subscriber: rnk.Jan 17 2019, 11:32 AM

Crazy idea: use musttail (only some targets support it) to make this work. Of course, first, make it correct.

vsk added a comment.Jan 17 2019, 11:52 AM
In D56865#1362011, @rnk wrote:

Crazy idea: use musttail (only some targets support it) to make this work. Of course, first, make it correct.

That's really clever :). As identical vararg functions are a bit of an uncommon case, I'm not sure the added complexity would be worth it, though.

nikic accepted this revision.Jan 18 2019, 11:44 AM

LGTM

On a related note, we have another case where thunks may be invalid due to CC restrictions: https://bugs.llvm.org/show_bug.cgi?id=40232

This revision is now accepted and ready to land.Jan 18 2019, 11:44 AM
This revision was automatically updated to reflect the committed changes.