6 Commits

Author SHA1 Message Date
Craig Topper 6d5fc62c9b [PartialInlineLibCalls] Teach PartialInlineLibCalls to honor nobuiltin, properly check the function signature, and check TLI::has
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.

Fixes PR32559.

Reviewers: hfinkel, spatel, davide, efriedma

Reviewed By: davide, efriedma

Subscribers: efriedma, llvm-commits, eraman

Differential Revision: https://reviews.llvm.org/D39381

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316819 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-28 00:36:58 +00:00
Michael Kuperstein 45e8fce689 Add positive test for sqrt "partial inlining". NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291009 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 21:24:56 +00:00
Michael Kuperstein 190574e2d6 Remove accidentally target-dependent test and pacify bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291004 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 21:08:53 +00:00
Michael Kuperstein 7f23c0f86c Add positive test for sqrt "partial inlining". NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291001 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-04 20:48:30 +00:00
Davide Italiano 613d807439 [PM] Port PartiallyInlineLibCalls to the new pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270798 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 23:38:53 +00:00
Peter Collingbourne f425efdbc2 PartiallyInlineLibCalls: Check sqrt result type before transforming it.
Some configure scripts declare this with the wrong prototype, which can lead
to an assertion failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214593 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-01 23:21:21 +00:00