This is an archive of the discontinued LLVM Phabricator instance.

[PartialInlineLibCalls] Teach PartialInlineLibCalls to honor nobuiltin, properly check the function signature, and check TLI::has
ClosedPublic

Authored by craig.topper on Oct 27 2017, 12:47 PM.

Details

Summary

We shouldn't do this transformation if the function is marked nobuitlin.

We were only checking that the return type is floating point, we really should be checking the argument types and argument count as well. This can be accomplished by using the other version of getLibFunc that takes the Function and not just the name.

We should also be checking TLI::has since sqrtf is a macro on Windows.

Happy to split this up if we want.

Fixes PR32559.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Oct 27 2017, 12:47 PM
davide edited edge metadata.Oct 27 2017, 12:50 PM

I guess this is fine, as this was particularly broken before, but please wait for another opinion.

efriedma accepted this revision.Oct 27 2017, 2:22 PM
efriedma added a subscriber: efriedma.

LGTM

This revision is now accepted and ready to land.Oct 27 2017, 2:22 PM
davide accepted this revision.Oct 27 2017, 2:24 PM

Forgot to click accept

This revision was automatically updated to reflect the committed changes.