]> granicus.if.org Git - llvm/commit
[PartialInlineLibCalls] Teach PartialInlineLibCalls to honor nobuiltin, properly...
authorCraig Topper <craig.topper@intel.com>
Sat, 28 Oct 2017 00:36:58 +0000 (00:36 +0000)
committerCraig Topper <craig.topper@intel.com>
Sat, 28 Oct 2017 00:36:58 +0000 (00:36 +0000)
commit6d5fc62c9bffc9f89905b3047c706843f0e9da6a
treeda6af34af2d9996dec06707cc47693b696a586a9
parentb35e220e58d1539477f492eff397c810209c2cea
[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
lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp
test/Transforms/PartiallyInlineLibCalls/bad-prototype.ll
test/Transforms/PartiallyInlineLibCalls/nobuiltin.ll [new file with mode: 0644]